[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
changing multiple-value calls in emacs code.
From: |
Dave Goel |
Subject: |
changing multiple-value calls in emacs code. |
Date: |
Fri, 13 Mar 2009 15:42:02 -0400 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) |
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))).
While the former is == the latter, the latter is the proper "RIGHT"
way of setq-ing a and b to members of a list.
I have committed some such changes. Please let me know if you think I did
anything wrong.
It is just a cosmetic change, since values-list just returns its
argument unchanged.
----
It is much rarer still that a function actually invokes any m-v
facility and returns (values ..) in its output. This happens only in
mh.el .. In emacs, we want to stay away using m-v, and such (values)
should be changed to (list.. ). Of course, this is again a cosmetic
change.
The uses of these values should again be used by (multiple-value-bind
... (values-list ... ))
----
I restress that any changes I made above are merely cosmetic changes.
(But, with a proper m-v facility, like the one I am proposing, these
changes will matter. Furthermore, these changes ensure that we never
use m-v facitily by default any way.)
- changing multiple-value calls in emacs code.,
Dave Goel <=