|
|
| No such thing as a small change | |
| PerlMonks |
Re: C# reinvents @_by Dominus (Parson) |
| on Sep 21, 2001 at 06:52 UTC ( [id://113819]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
Says hding:
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:
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.
--
In Section
Meditations
|
|
||||||||||||||||||||||||||||