in reply to Re: Re: C# reinvents @_
in thread C# reinvents @_
I had the same thought about Lisp when I first saw this post, but after looking around a bit, I wasn't able to find any way to do this properly in Common Lisp.
It seems to me that this is exactly what you want:
(defun myfunction (&rest args) ...)
In the body of myfunction, the parameter args is bound to the entire argument list, which is analogous to @_ in Perl.
I don't understand your point about &optional. I thought we were looking for a way to simulate Perl's parameter-passing mechanism in Common Lisp; this is it. Perl doesn't have &optional; instead, you're supposed to examine the contents of @_ and make a decision depending on how many elements it contains. With the args parameter above, you are free to do the same thing in the same way.
--
Mark Dominus
Perl Paraphernalia
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: C# reinvents @_
by hding (Chaplain) on Sep 21, 2001 at 23:13 UTC |