Re: SETF for functions returning multiple values.

"John DeSoi (as john at desoi dot dev)" <[email protected]> Mon, 8 Jun 2026 18:54:42 +0000
Newsgroups gmane.lisp.lispworks.general
Message-ID <0100019ea8964ce4-c057cd56-70c8-46f8-ad1e-b079a4896bb1-000000@email.amazonses.com>
CAPI uses this:

static-layout-child-geometry pinboard-object-or-pane => x, y, width, height

setf (static-layout-child-geometry pinboard-object-or-pane) (values x y width height) => x, y, width, height


John DeSoi, Ph.D.



> On Jun 8, 2026, at 1:02 PM, Tim Bradshaw (as tfb at tfeb dot org) <[email protected]> wrote:
> 
> (setf (values p1 p2) <form-returning-two-values>) should work when p1 and p2 are places (the spec talks about this).
> 
> If F is a function returning two values, then you can't write a (SETF F) function for it, but you can write a setf expansion pretty easily.  So then you just can say (setf (f ...) (values v1 v2)).
> 
> I don't think I've seen this done elsewhere.  Does it strike people as reasonable?