aif.rkt (331B)
1 #lang racket/base 2 3 (provide aif it) 4 (require anaphoric/it 5 racket/stxparam 6 (for-syntax racket/base)) 7 8 (define-syntax-rule (aif condition true-branch false-branch) 9 (let ([tmp condition]) 10 (if tmp 11 (syntax-parameterize ([it (make-rename-transformer #'tmp)]) 12 true-branch) 13 false-branch)))