unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Dave Goel <deego3@gmail.com>
To: emacs-devel@gnu.org
Subject: changing multiple-value calls in emacs code.
Date: Fri, 13 Mar 2009 15:42:02 -0400	[thread overview]
Message-ID: <87fxhh5hx1.fsf@marie.gnufans.net> (raw)

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





             reply	other threads:[~2009-03-13 19:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-13 19:42 Dave Goel [this message]
2009-03-13 20:57 ` changing multiple-value calls in emacs code Dave Goel
2009-03-14 10:07   ` Tobias C. Rittweiler
2009-03-14 10:50     ` Miles Bader
2009-03-14  0:21 ` Miles Bader

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fxhh5hx1.fsf@marie.gnufans.net \
    --to=deego3@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).