8.15.0.12
17.14.7 Unquote Binding Macros
Unquote binding forms are similar to normal binding forms, but they appear only under $ within a syntax binding pattern. Unquote binding forms are distinct from normal binding forms because they must match syntax objects; some operators work in both contexts but have different meanings, such as :: and _ for unquote bindings versus :: and _ for normal bindings.
space | |
definition | |
Like expr.macro, but for binding an identifier or operator
that works within a $ escape for a syntax pattern.
The macro is bound in the unquote_bind space.
> unquote_bind.macro 'dots':
'«'$('...')'»'
> match Syntax.make_group(['...', '...', '...'])
| '$dots ...': "all dots"
"all dots"
> syntax_class Wrapped
| '($content)'
| '[$content]'
| '{$content}'
> unquote_bind.macro 'wrapped $(id :: Identifier)':
> match '{x} [y] (z)'
| '$(wrapped a) ...': [a, ...]
['x', 'y', 'z']