From: Jim Newton
Subject: what should extract-lambda-list return on &rest &optional etc?
Date: 
Message-ID: <32ramkF3nn30oU1@individual.net>
I've reading the book (again) "The Art of the Metaobject Protocol"
and I do not understand the function EXTRACT-LAMBDA-LIST
on page 188 and 189.

The examples say that (extract-lambda-list '( a (b (eql x)) c &rest i)
should return ( A B C &OPTIONAL I), but when i try this in
cmucl i see that it returns the more intuitive ( A B C &REST I).

Is this a mistake in the book, or is the implementation allows
to return &OPTIONAL instead of &REST?

I cannot find the function EXTRACT-LAMBDA-LIST in my version
of clisp so i cannot check it there.

-jim

From: Thomas A. Russ
Subject: Re: what should extract-lambda-list return on &rest &optional etc?
Date: 
Message-ID: <ymiy8fr47uh.fsf@sevak.isi.edu>
Jim Newton <·····@rdrop.com> writes:

> 
> I've reading the book (again) "The Art of the Metaobject Protocol"
> and I do not understand the function EXTRACT-LAMBDA-LIST
> on page 188 and 189.
> 
> The examples say that (extract-lambda-list '( a (b (eql x)) c &rest i)
> should return ( A B C &OPTIONAL I), but when i try this in
> cmucl i see that it returns the more intuitive ( A B C &REST I).
> 
> Is this a mistake in the book, or is the implementation allows
> to return &OPTIONAL instead of &REST?

I don't have the book, but it certainly seems to be a mistake.
&OPTIONAL and &REST are certainly different in what they allow as far as
input parameters and also insofar as what they deliver.



-- 
Thomas A. Russ,  USC/Information Sciences Institute
From: Jim Newton
Subject: Re: what should extract-lambda-list return on &rest &optional etc?
Date: 
Message-ID: <32rau6F3r8445U1@individual.net>
i also notice that the alegro 7.0 documentation
says that '( a (b (eql x)) c &rest i) map to
( A B C &OPTIONAL I) and not to ( A B C &REST I).
However, i do not have a copy of alegro so i
cannot check that one either.


Jim Newton wrote:
> I've reading the book (again) "The Art of the Metaobject Protocol"
> and I do not understand the function EXTRACT-LAMBDA-LIST
> on page 188 and 189.
> 
> The examples say that (extract-lambda-list '( a (b (eql x)) c &rest i)
> should return ( A B C &OPTIONAL I), but when i try this in
> cmucl i see that it returns the more intuitive ( A B C &REST I).
> 
> Is this a mistake in the book, or is the implementation allows
> to return &OPTIONAL instead of &REST?
> 
> I cannot find the function EXTRACT-LAMBDA-LIST in my version
> of clisp so i cannot check it there.
> 
> -jim
> 
From: Pascal Costanza
Subject: Re: what should extract-lambda-list return on &rest &optional etc?
Date: 
Message-ID: <cqa4lb$4lf$1@newsreader2.netcologne.de>
Jim Newton wrote:
> I've reading the book (again) "The Art of the Metaobject Protocol"
> and I do not understand the function EXTRACT-LAMBDA-LIST
> on page 188 and 189.
> 
> The examples say that (extract-lambda-list '( a (b (eql x)) c &rest i)
> should return ( A B C &OPTIONAL I), but when i try this in
> cmucl i see that it returns the more intuitive ( A B C &REST I).
> 
> Is this a mistake in the book, or is the implementation allows
> to return &OPTIONAL instead of &REST?

I guess it's a mistake in the book. We should just pretend that the 
examples are not binding, similar to what the ANSI standard says.

Allegro also returns &rest instead of &optional in the result. Also note 
that the MOP spec that comes with Allegro has been built from the same 
sources as other instances of that spec.


Pascal

-- 
The big bang way only works for god, everybody else has to use 
evolution. - David Moon
From: Geoffrey Summerhayes
Subject: Re: what should extract-lambda-list return on &rest &optional etc?
Date: 
Message-ID: <R08yd.14790$GK5.1083948@news20.bellglobal.com>
"Jim Newton" <·····@rdrop.com> wrote in message ····················@individual.net...
> I've reading the book (again) "The Art of the Metaobject Protocol"
> and I do not understand the function EXTRACT-LAMBDA-LIST
> on page 188 and 189.
>
> The examples say that (extract-lambda-list '( a (b (eql x)) c &rest i)
> should return ( A B C &OPTIONAL I), but when i try this in
> cmucl i see that it returns the more intuitive ( A B C &REST I).
>
> Is this a mistake in the book, or is the implementation allows
> to return &OPTIONAL instead of &REST?
>
> I cannot find the function EXTRACT-LAMBDA-LIST in my version
> of clisp so i cannot check it there.
>

IMO mistake, look on page 298-299 for the Closette implementation:

  ,@(if rv `(&rest ,rv) ())

--
Geoff