Suzanne Soy <racket@suzanne.soy>
This package allows using syntax pattern variables outside of syntax templates: when x is bound as a syntax pattern variable, writing x then becomes roughly equivalent to (syntax->datum #'x-ddd), where x-ddd is x wrapped under the appropriate number of ellipses. If the pattern variable is bound by syntax-parse and contains non-syntax parts (e.g. it was bound within an ~optional clause, or using #:attr), they are left unchanged.
syntax
( auto-with-syntax ([patᵢeᵢ]...)body...)
'(124 #<syntax:eval:1:0 123>)
syntax
( auto-syntax (pvarᵢ...)body...)
'((2 3 4) #<syntax:eval:1:0 (1 2 3)>)
'(((1 . 2) (3 . #f))
(#<syntax:eval:2:0 1> #<syntax:eval:2:0 3>)
(#<syntax:eval:2:0 2> #f))
When one of the pvarᵢ... is not a syntax pattern variable, it is ignored and the existing binding, if any, is left untouched.
Note that it is not necessary to specify the ellipsis-depth of each pvarᵢ.
syntax
[patᵢmaybe-guardᵢbodyᵢ]...)maybe-guardᵢ =| guard-expression