-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
macros: add stamp
for unquoting a template body
#1426
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor correction in the doc block to make it explicit what the behaviour of stamp
is, also I'll update the PR body a bit, just lead with the introduction of the new macro and its behaviour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the elaborate documentation and examples! I'm not super happy of having this behaviour be in the standard library, but at least it's properly documented now, with all it's quirks.
There's one problem with the documentation that needs fixing, and some few other things that should be changed, but this looks good to me otherwise.
Updated the PR body so it leads with the change. |
29e0c05
to
98c2f57
Compare
Co-authored-by: zerbina <[email protected]>
Co-authored-by: Saem Ghani <[email protected]>
/merge |
Merge requested by: @zerbina Contents after the first section break of the PR description has been removed and preserved below:
|
Summary
Add
stamp
tostd/macros
, which takes a template body and appliesit immediately. This is the same behaviour as the previous
quote
that was changed after #1393.
Details
After #1393 we have a hole in
the stdlib for
quote
-like interpolation but with automatic bindingof symbols to reduce boilerplate. Various libraries within the ecosystem
such as
criterion
andnpeg
have found the feature useful andextensively employ it.
Reintroduces old
quote
behavior asstamp
, without support forcustom operators and explicitly document the template-like nature of
stamp
's body as well as its pitfalls.This macro was originally written and shared to Matrix by @zerbina.