Re: SETF for functions returning multiple values.
"Tim Bradshaw (as tfb at tfeb dot org)" <[email protected]> Mon, 8 Jun 2026 21:01:40 +0100
| Newsgroups | gmane.lisp.lispworks.general |
|---|---|
| Message-ID | <[email protected]> |
That answers my question, thank you! > On 8 Jun 2026, at 19:55, John DeSoi <[email protected]> wrote: > > 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? >