Subject: Re: Three questions
From: rpw3@rpw3.org (Rob Warnock)
Date: Sat, 20 Jun 2009 22:13:07 -0500
Newsgroups: comp.lang.lisp
Message-ID: <w_OdnbxDes7eOKDXnZ2dnUVZ_g2dnZ2d@speakeasy.net>
vippstar  <vippstar@gmail.com> wrote:
+---------------
| On Jun 19, 11:40�am, r...@rpw3.org (Rob Warnock) wrote:
| > Thomas A. Russ <t...@sevak.isi.edu> wrote:
| > +---------------
| > | Again, this is already the normal function of LET binding of global
| > | variables. You would just write
| > | (defun my-car2 (list)
| > |  (let ((*list* list))
| > |    (my-car)))
| > | and you would be done.
| > +---------------
| >
| > Even simpler:  ;-}
| >
| >  (defun my-car2 (*list*)
| >    (my-car))
| 
| More robust:
| (defun my-car2 (*list* *list*)
|   (my-car))
+---------------

That's not valid Common Lisp, and is therefore hardly "more robust".
You're not supposed to name the same variable twice in a lambda list.

Did you mean to write this, perhaps?

    (defun my-car2 (&optional (*list* *list*))
      (my-car))


-Rob

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607