From: Frode Vatvedt Fjeld
Subject: Push and pop of multi-cell places
Date: 
Message-ID: <2hptz3tc4m.fsf@vserver.cs.uit.no>
If (values p1 p2 p3) denotes a place with three cells (as per HS
5.1.2.3 VALUES Forms as Places), what is the defined behavior of for
example

  (let ((p1 (list 'v1))
        (p2 (list 'v2))
        (p3 (list 'v3)))
    (push (values 'foo 'bar 'baz)
          (values p1 p2 p3)))

I.e. is push, pop, and similar place-aware operators supposed to deal
with such multi-cell places, or is this undefined, or what?

For the above example, CLisp does the Right Thing and returns (foo v1),
(bar v2), and (baz v3). CMUCL fails during macroexpansion. Franz ACL
apparently ignores but the "primary place" for the push operation,
although it passes on the other values to return (foo v1), (v2), and (v3).

Can anyone shed some light on this?

-- 
Frode Vatvedt Fjeld

From: Barry Margolin
Subject: Re: Push and pop of multi-cell places
Date: 
Message-ID: <7r4M8.7$rs6.249@paloalto-snr2.gtei.net>
In article <··············@vserver.cs.uit.no>,
Frode Vatvedt Fjeld  <······@acm.org> wrote:
>If (values p1 p2 p3) denotes a place with three cells (as per HS
>5.1.2.3 VALUES Forms as Places), what is the defined behavior of for
>example
>
>  (let ((p1 (list 'v1))
>        (p2 (list 'v2))
>        (p3 (list 'v3)))
>    (push (values 'foo 'bar 'baz)
>          (values p1 p2 p3)))
>
>I.e. is push, pop, and similar place-aware operators supposed to deal
>with such multi-cell places, or is this undefined, or what?
>
>For the above example, CLisp does the Right Thing and returns (foo v1),
>(bar v2), and (baz v3). CMUCL fails during macroexpansion. Franz ACL
>apparently ignores but the "primary place" for the push operation,
>although it passes on the other values to return (foo v1), (v2), and (v3).
>
>Can anyone shed some light on this?

The description of PUSH refers to the place containing a list, which is
singular.  Nothing in the description suggests that it should iterate over
all the lists if the place is multiple-valued; since the standard doesn't
say what should happen in this case, Clisp's behavior is an allowable
extension, but it's not required.  Portable programs should not depend on
any specific behavior in this case.

-- 
Barry Margolin, ······@genuity.net
Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
From: Pierpaolo BERNARDI
Subject: Re: Push and pop of multi-cell places
Date: 
Message-ID: <lH4M8.13285$TS.394803@news1.tin.it>
"Frode Vatvedt Fjeld" <······@acm.org> ha scritto nel messaggio ···················@vserver.cs.uit.no...
> If (values p1 p2 p3) denotes a place with three cells (as per HS
> 5.1.2.3 VALUES Forms as Places), what is the defined behavior of for
> example
>
>   (let ((p1 (list 'v1))
>         (p2 (list 'v2))
>         (p3 (list 'v3)))
>     (push (values 'foo 'bar 'baz)
>           (values p1 p2 p3)))
>
> I.e. is push, pop, and similar place-aware operators supposed to deal
> with such multi-cell places, or is this undefined, or what?
>
> For the above example, CLisp does the Right Thing and returns (foo v1),
> (bar v2), and (baz v3). CMUCL fails during macroexpansion. Franz ACL
> apparently ignores but the "primary place" for the push operation,
> although it passes on the other values to return (foo v1), (v2), and (v3).
>
> Can anyone shed some light on this?

LispWorks also chokes on this.

ACL lists this as a known bug in their docs.

P.
From: Steven M. Haflich
Subject: Re: Push and pop of multi-cell places
Date: 
Message-ID: <3D0606B1.7020300@alum.mit.edu>
Pierpaolo BERNARDI wrote:


>>  (let ((p1 (list 'v1))
>>        (p2 (list 'v2))
>>        (p3 (list 'v3)))
>>    (push (values 'foo 'bar 'baz)
>>          (values p1 p2 p3)))
>>
>>I.e. is push, pop, and similar place-aware operators supposed to deal
>>with such multi-cell places, or is this undefined, or what?

> ACL lists this as a known bug in their docs.

Pierpaolo:  Can you cite the reference for this?  There was a time
when ACL setf expanders mostly didn't handle multiple value places,
but these were all fixed about five years ago.
From: Pierpaolo BERNARDI
Subject: Re: Push and pop of multi-cell places
Date: 
Message-ID: <T_pN8.24539$TS.735598@news1.tin.it>
From: "Steven M. Haflich" <·················@alum.mit.edu>

> > ACL lists this as a known bug in their docs.
>
> Pierpaolo:  Can you cite the reference for this?  There was a time
> when ACL setf expanders mostly didn't handle multiple value places,
> but these were all fixed about five years ago.

In par. 41.9.0 "Conformance with the ANSI specification"
(URL: implementation.htm#compliance-1) item 39 is:

  "Allegro CL does not implement setf of values."

Which I read as meant to include the PUSH case
discussed in the news article too.

I have not checked whether the implementation agrees
with the doc, or the doc is outdated.

(P.S. I'd appreciate if when sending an email copy
of an article also posted in ng's, people could identify
it as such).

Cheers
Pierpaolo