12 lines
289 B
Racket
12 lines
289 B
Racket
#lang racket/base
|
|
|
|
(provide awhen it)
|
|
(require anaphoric/it
|
|
racket/stxparam
|
|
(for-syntax racket/base))
|
|
|
|
(define-syntax-rule (awhen condition . body)
|
|
(let ([tmp condition])
|
|
(when tmp
|
|
(syntax-parameterize ([it (make-rename-transformer #'tmp)])
|
|
. body)))) |