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

acond.rkt (464B)


      1 #lang racket/base
      2 
      3 (provide acond it)
      4 (require anaphoric/it
      5          racket/stxparam
      6          (for-syntax racket/base))
      7 
      8 (define-syntax (acond stx)
      9   (syntax-case stx (else)
     10     [(_ [else . else-body])
     11      #'(begin . else-body)]
     12     [(_)
     13      #'(void)]
     14     [(_ [condition . body] . rest)
     15      #'(let ([tmp condition])
     16          (if tmp
     17              (syntax-parameterize ([it (make-rename-transformer #'tmp)])
     18                . body)
     19              (acond . rest)))]))