kzccm1d4if10m2xaz1wqy3xar821pp1r-my-site-anaphoric-git.test.suzanne.soy-0.0.1

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

README.md (1565B)


      1 [![Build Status,](https://img.shields.io/travis/jsmaniac/anaphoric/main.svg)](https://travis-ci.org/jsmaniac/anaphoric)
      2 [![Coverage Status,](https://img.shields.io/codecov/c/github/jsmaniac/anaphoric/main.svg)](https://codecov.io/gh/jsmaniac/anaphoric)
      3 [![Build Stats,](https://img.shields.io/badge/build-stats-blue.svg)](http://jsmaniac.github.io/travis-stats/#jsmaniac/anaphoric)
      4 [![Online Documentation,](https://img.shields.io/badge/docs-online-blue.svg)](http://docs.racket-lang.org/anaphoric/)
      5 [![Maintained as of 2021,](https://img.shields.io/maintenance/yes/2021.svg)](https://github.com/jsmaniac/anaphoric/issues)
      6 [![License: CC0 v1.0.](https://img.shields.io/badge/license-CC0-blue.svg)](https://creativecommons.org/publicdomain/zero/1.0/)
      7 
      8 anaphoric
      9 =========
     10 
     11 Anaphoric conditional forms for `racket`:
     12 
     13 ```
     14 (aif (member 'a lst)
     15   (displayln it)
     16   (displayln "not found")) ;; Can't use "it" in the else clause.
     17 
     18 (awhen (member 'a lst)
     19   (displayln it))
     20 
     21 (acond
     22   [(member 'a lst) (displayln it)]
     23   [(member 'b lst) (displayln it)]
     24   [else (displayln "not found")]) ;; Can't use "it" in the else clause.
     25 ```
     26 
     27 This package also provides hygienic versions:
     28 
     29 ```
     30 (if-let [x (member 'a lst)]
     31   (displayln x)
     32   (displayln "not found")) ;; Can't use "x" in the else clause.
     33 
     34 (when-let [x (member 'a lst)]
     35   (displayln it))
     36 
     37 (cond-let x
     38   [(member 'a lst) (displayln x)]
     39   [(member 'b lst) (displayln x)]
     40   [else (displayln "not found")]) ;; Can't use "x" in the else clause.
     41 ```
     42 
     43 Installation
     44 ------------
     45 
     46 ```
     47 raco pkg install --deps search-auto anaphoric
     48 ```