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

@closure with unnamed anonymous function declared with "function" keyword? #19

Open
colinxs opened this issue Feb 19, 2020 · 1 comment

Comments

@colinxs
Copy link

colinxs commented Feb 19, 2020

Is there a reason why this is disallowed?

@closure function (x,y,z)
    x+a
end

It stems from this assert here:

@assert isexpr(ex.args[1], :call)

Happy to contribute a PR to handle this case, but just wanted to check if there's a reason for that assert. Seems related to #1.

@c42f
Copy link
Owner

c42f commented Feb 20, 2020

Happy to contribute a PR to handle this case

Please do! The reason this exists is because FastClosures doesn't understand the full set of anonymous function syntaxes: we need to reproduce parts of lowering within the macro to get access to allow each the possible syntactic forms.

The solution is to add code which recognizes more of the forms.

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

2 participants