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

optional support for es6 spread operator/rest parameters? #93

Open
riatzukiza opened this issue Jun 2, 2016 · 0 comments
Open

optional support for es6 spread operator/rest parameters? #93

riatzukiza opened this issue Jun 2, 2016 · 0 comments

Comments

@riatzukiza
Copy link

Currently the compiler produces some strange looking application operation when the spread operator is used, and always uses "this" as the first arguement to the operation, which is not always what is intended, take for example:

(this.foo.method ...array-of-stuff)
;; -> this.foo.method.apply(this,arrayOfStuff);

This is obviously not what was intended to be done, and normally means that to use this feature one has to destructure the array outside of the context of the functions execution if the desired behavior is to occur.

It should not be difficult to get the above to translate instead to

this.foo.method(...arrayOfStuff);

As it would just be a direct symbol insertion.

It should be possible for me to do this for my self with a macro at least, but documentation on macros is sparse, and basicly non-existant for reader macros, which is how I imagine this would need to be done.

If I could at least be pointed in the right direction to create a macro that would override the "..." syntax that exists already, this would be appriciated.

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

1 participant