From: Mitch
Subject: Multiple value setf
Date: 
Message-ID: <vaoco3h6v3eq9pt75kvk4p1qndj6g5mbod@4ax.com>
I'd like to override a Lispworks setf function which accepts multiple
values, but I don't see how to write a defmethod to sef a function
with multiple values.

Specifically (setf capi:pinboard-pane-size) can be given x and y
values.

Mitch

From: danb
Subject: Re: Multiple value setf
Date: 
Message-ID: <6f2dcc70-df12-41c2-b463-aa37605f3857@i29g2000prf.googlegroups.com>
On Jan 10, 12:23 pm, Mitch <········@bermita.com> wrote:
> I'd like to override a Lispworks setf function which accepts
> multiple values, but I don't see how to write a defmethod
> to sef a function with multiple values.  Specifically
> (setf capi:pinboard-pane-size) can be given x and y values.

What do you mean by "given"?  You can use multiple-value-call if
you're trying to call the function with x and y as args.  If you're
trying to create a closure around x and y, then you can use
multiple-value-bind to bind x and y before defining the function.
What do you want to use SETF for?

--Dan
www.prairienet.org/~dsb/
From: Kalle Olavi Niemitalo
Subject: Re: Multiple value setf
Date: 
Message-ID: <87fxx4dr5g.fsf@Astalo.kon.iki.fi>
danb <·········@gmail.com> writes:

> On Jan 10, 12:23 pm, Mitch <········@bermita.com> wrote:
>> Specifically (setf capi:pinboard-pane-size) can be given
>> x and y values.
>
> What do you mean by "given"?

LispWorks documents capi:pinboard-pane-size at:
http://www.lispworks.com/documentation/lw445/CAPRM/html/capiref-238.htm

Near the end of the page, there is this sample subform:
(setf (capi:pinboard-pane-size po)
      (values new-x new-y))

Two values are being "given".
From: Kalle Olavi Niemitalo
Subject: Re: Multiple value setf
Date: 
Message-ID: <87bq7ttjne.fsf@Astalo.kon.iki.fi>
Mitch <········@bermita.com> writes:

> I'd like to override a Lispworks setf function which accepts multiple
> values, but I don't see how to write a defmethod to sef a function
> with multiple values.

In standard Common Lisp, a setf function cannot take multiple values.
(macroexpand-1 '(setf (capi:pinboard-pane-size p) (values width height)))
should reveal if the setf expander of capi:pinboard-pane-size
redirects the operation to a generic function, to which you could
then add your method.  It may be unexported and undocumented though.

To implement a place that takes multiple values, one can use
either the long form of DEFSETF, or DEFINE-SETF-EXPANDER.
The short form of DEFSETF is unable to generate the correct
number of store variables in a setf expansion.