in reply to Re: Re: C# reinvents @_
in thread C# reinvents @_

Hmm, I thought you could have unnamed parameters collected into a list. My Lisp-dialects are 10 years rusty, and Common Lisp is just a manual to me. Maybe it was dropped from the standard, or has some more obsucre way to set it up. Or, maybe it's just so simple to throw another set of ()'s around the data that nobody cares.

(foo one two (three four five))
is similar to
sub foo ($$$); foo ($one, $two, [$three, $four, $five]);
with exactly three parameters according to the function, but the caller does the "collecting".

Replies are listed 'Best First'.
Re: Re: Re: Re: C# reinvents @_
by hding (Chaplain) on Sep 19, 2001 at 19:57 UTC

    I agree, it's the kind of thing that screams out "Lisp!", but I just couldn't think of how to do it. Guess we'll have to leave it to the Lisp historians.

    Update: Just in case anybody actually reads this and I'm not being clear, one can simulate the Perlish behavior simply by having a function like (defun fred (&rest args) (do-stuff-with args)). In fact, by treating args as a plist, one can simulate the Perl trick of passing a hash. What I can't see is how to get all the arguments as a list while still using Lisp's other facilities for handling them.