Skip to content
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

Code in macro arguments should also be detached, just like code in quasis #495

Open
masak opened this issue Apr 16, 2019 · 0 comments
Open
Labels

Comments

@masak
Copy link
Owner

masak commented Apr 16, 2019

What #474 did for quasis, we also need to do for macro arguments.

I started to suspect/remember this as I was working on the #116 stuff and really throwing code around. Here's a golfed bit of code showcasing the problem:

$ bin/007 -e='macro sq(x) { quasi { my n = 5; {{{x}}} * {{{x}}} } }; my n = 7; say(sq(n))'
25

We get a hygiene leak there, and get 25 instead of 49, because the n that gets transported into the macro via the argument x isn't being detached.

#380 is related; it's talking about putting code back. Here we're talking about pulling code away.

@masak masak added the defect label Apr 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant