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

assignment in line decorators #375

Open
ghost opened this issue Nov 17, 2018 · 0 comments
Open

assignment in line decorators #375

ghost opened this issue Nov 17, 2018 · 0 comments

Comments

@ghost
Copy link

ghost commented Nov 17, 2018

Would it be possible to add conditional assignment to line decorators? For example, I can do option 1:
fcolor=message\match "<%w*>"
message=message\gsub "<%->", fcolor if fcolor

Or option 2:
message=message\gsub "<%->", fcolor if (->fcolor=message\match "<%w*>" )!

But option 2 creates an anonymous function. The following would be better:

message=message\gsub "<%->", fcolor if fcolor=message\match "<%w*>"
compiled to the same output as
if fcolor=message\match "<%w*>" then message=message\gsub "<%->", fcolor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants