2 ms·
Your code (`when` that binds `it`) translates to: (define-syntax (awhen stx) (syntax-case stx () ((_ expr body ...) (with-syntax ((it (datum
by mordae 13y ago
Your code (`when` that binds `it`) translates to:
(define-syntax (awhen stx)
(syntax-case stx ()
((_ expr body ...)
(with-syntax ((it (datum->syntax stx 'it)))
#`(let ((it expr))
(when it body ...))))))
I find it a bit hairy, but mostly sane. It's all about being hygienic. Notice how you explicitly place the `it` identifier into the caller's context but keep the usual let and when?