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

Method for gathering an argument list? #3

Closed
davep opened this issue Apr 2, 2012 · 2 comments
Closed

Method for gathering an argument list? #3

davep opened this issue Apr 2, 2012 · 2 comments

Comments

@davep
Copy link

davep commented Apr 2, 2012

I'll admit that my Scheme is a little rusty, so forgive me if I'm missing something.

I was looking for a way to get the whole argument list of a function in a single variable. The way I recall doing this in scheme is as follows:

(define (pointless-list . args) args)

The result of the above being something like:

> (pointless-list 1 2 3 4)
(1 2 3 4)

However, in ECMAchine:

ecmachine:/startup guest$ (define (pointless-list . args) args)
ecmachine:/startup guest$ (pointless-list 1 2 3 4)
[USER]: Apply Error: Incorrect number of parameters: expecting (. args) but received (1 2 3 4)

Am I missing something or is this an omission?

@AlexNisnevich
Copy link
Owner

You're right - this is an omission. At the moment, there's no way to get the whole argument list of a function.

@AlexNisnevich
Copy link
Owner

Note to self: function objects probably need to have a new boolean property that is true iff the final argument takes all remaining arguments passed in.

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