Anaphoric macros for racket
Go to file
2021-07-29 01:50:14 +01:00
.github/workflows Create build-status-check job which depdends on all others so that it can be used as a required status check for the main branch 2021-07-29 01:50:14 +01:00
scribblings Fixed syntax error in documentation 2021-07-28 19:54:00 +01:00
test Uniformize afilter and amap tests 2021-07-28 21:10:17 +01:00
.gitignore Initial commit 2016-04-08 11:12:18 +02:00
.travis.yml Added later versions of Racket to the build 2021-02-26 15:22:06 +00:00
aand.rkt Fix aand 2018-08-23 03:12:20 -04:00
acond.rkt Use #lang racket/base instead of #lang racket 2018-01-27 12:05:21 +01:00
afilter.rkt Add anaphoric map and filter (squashed commit) 2021-07-12 11:18:01 +08:00
aif.rkt Use #lang racket/base instead of #lang racket 2018-01-27 12:05:21 +01:00
amap.rkt Add anaphoric map and filter (squashed commit) 2021-07-12 11:18:01 +08:00
and-let.rkt Require syntax/parse since syntax/parse/define isn't used 2018-05-31 20:19:23 +02:00
awhen.rkt Use #lang racket/base instead of #lang racket 2018-01-27 12:05:21 +01:00
cond-let.rkt 100% test coverage 2021-02-27 16:05:28 +00:00
if-let.rkt Use #lang racket/base instead of #lang racket 2018-01-27 12:05:21 +01:00
info.rkt Changed my name :) 2021-02-26 15:16:06 +00:00
it.rkt Use #lang racket/base instead of #lang racket 2018-01-27 12:05:21 +01:00
LICENSE-more.md Changed my name :) 2021-02-26 15:16:06 +00:00
LICENSE.txt Switched to Public Domain / CC0 license now that I got permission from Cortus to release the packages in the Public Domain and from Alex Knauth for this package. This ensures that the code can be merged into other Racket projects, regardless of future license changes for the Racket project. 2017-01-20 14:28:53 +01:00
main.rkt Add aand 2018-01-27 12:04:17 +01:00
README.md Updated "maintained" badge 2021-05-11 01:22:50 +01:00
when-let.rkt Use #lang racket/base instead of #lang racket 2018-01-27 12:05:21 +01:00

Build Status, Coverage Status, Build Stats, Online Documentation, Maintained as of 2021, License: CC0 v1.0.

anaphoric

Anaphoric conditional forms for racket:

(aif (member 'a lst)
  (displayln it)
  (displayln "not found")) ;; Can't use "it" in the else clause.

(awhen (member 'a lst)
  (displayln it))

(acond
  [(member 'a lst) (displayln it)]
  [(member 'b lst) (displayln it)]
  [else (displayln "not found")]) ;; Can't use "it" in the else clause.

This package also provides hygienic versions:

(if-let [x (member 'a lst)]
  (displayln x)
  (displayln "not found")) ;; Can't use "x" in the else clause.

(when-let [x (member 'a lst)]
  (displayln it))

(cond-let x
  [(member 'a lst) (displayln x)]
  [(member 'b lst) (displayln x)]
  [else (displayln "not found")]) ;; Can't use "x" in the else clause.

Installation

raco pkg install --deps search-auto anaphoric