unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* changing multiple-value calls in emacs code.
@ 2009-03-13 19:42 Dave Goel
  2009-03-13 20:57 ` Dave Goel
  2009-03-14  0:21 ` Miles Bader
  0 siblings, 2 replies; 5+ messages in thread
From: Dave Goel @ 2009-03-13 19:42 UTC (permalink / raw)
  To: emacs-devel

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.)





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-03-14 10:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-13 19:42 changing multiple-value calls in emacs code Dave Goel
2009-03-13 20:57 ` Dave Goel
2009-03-14 10:07   ` Tobias C. Rittweiler
2009-03-14 10:50     ` Miles Bader
2009-03-14  0:21 ` Miles Bader

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).