Skip to content

SuzanneSoy/anaphoric

Repository files navigation

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

About

Anaphoric macros for racket

Topics

Resources

License

CC0-1.0, Unknown licenses found

Licenses found

CC0-1.0
LICENSE.txt
Unknown
LICENSE-more.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages