anaphoric/aif.rkt
2016-04-08 12:16:33 +02:00

12 lines
292 B
Racket

#lang racket
(provide aif it)
(require anaphoric/it
racket/stxparam)
(define-syntax-rule (aif condition true-branch false-branch)
(let ([tmp condition])
(if tmp
(syntax-parameterize ([it (make-rename-transformer #'tmp)])
true-branch)
false-branch)))