Anaphoric macros for racket
Go to file
2017-01-19 20:19:38 +01:00
scribblings Documentation changes suggested by O. Andreescu. Thanks! 2016-08-15 01:20:57 +02:00
test Added tests, included newer Racket versions in .travis.yml 2016-08-08 13:15:02 +02:00
.gitignore Initial commit 2016-04-08 11:12:18 +02:00
.travis.yml Use codecov only on recent versions 2017-01-19 20:12:54 +01:00
acond.rkt Implemented aif, awhen and acond. 2016-04-08 12:16:33 +02:00
aif.rkt Implemented aif, awhen and acond. 2016-04-08 12:16:33 +02:00
awhen.rkt Implemented aif, awhen and acond. 2016-04-08 12:16:33 +02:00
cond-let.rkt Added if-let when-let and cond-let, as per Alex Knauth's suggestion. Closes issue #1. 2016-08-08 12:32:53 +02:00
if-let.rkt Added if-let when-let and cond-let, as per Alex Knauth's suggestion. Closes issue #1. 2016-08-08 12:32:53 +02:00
info.rkt Added if-let when-let and cond-let, as per Alex Knauth's suggestion. Closes issue #1. 2016-08-08 12:32:53 +02:00
it.rkt Implemented aif, awhen and acond. 2016-04-08 12:16:33 +02:00
LICENSE.txt Initial commit 2016-04-08 11:12:18 +02:00
main.rkt Implemented aif, awhen and acond. 2016-04-08 12:16:33 +02:00
README.md Changed README badge to use codecov.io 2017-01-19 20:19:38 +01:00
when-let.rkt Added if-let when-let and cond-let, as per Alex Knauth's suggestion. Closes issue #1. 2016-08-08 12:32:53 +02:00

Build Status, Coverage Status, Build Stats, Online Documentation.

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