[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: changing multiple-value calls in emacs code.

From: Miles Bader
Subject: Re: changing multiple-value calls in emacs code.
Date: Sat, 14 Mar 2009 09:21:45 +0900

Dave Goel <address@hidden> writes:
> There are a very few places in emacs that do things like
> (multiple-value-bind).  As we know, this does not in reality use any
> m-v facility, mostly it is meant to bind vars to a list, rather than
> to a host of values.  Indeed, (values-list) is an identity.
> In such cases, the right thing to do would be to change such calls:
> (multiple-value-setq (a b) (foo))
> to  (multiple-value-setq (a b) (values-list (foo))).

In cases where it uses `multiple-value-bind' in that way, instead of
adding `values-list', wouldn't it be more clear to just use
`destructuring-bind' (since that's what's actually meant)?

[The only wart is that you have to add `&rest' to the variable list if
there are values to be ignored, wheras.  It seems you don't need to
actually supply a variable following the &rest though; I dunno if
omitting it saves any consing or not...  destructuring-bind also does
more error-checking of the list before binding, I dunno if that's
desirable or not...]


Defenceless, adj. Unable to attack.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]