On Jun 14, 2009, at 6:01 PM, Abdulaziz Ghuloum wrote:
(define-syntax when-bound
(lambda (x)
(syntax-case x ()
[(ctxt (id) e* ...)
(let ([t (car (generate-temporaries '(t)))])
(if (free-identifier=? #'id
(datum->syntax t (syntax->datum #'id)))
#'(begin)
#'(begin e* ...)))])))
BTW, this is not a 100% correct definition of when-bound, but it should suffice for given need. Aziz,,,
