all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Ivan Shmakov <ivan@siamics.net>
Cc: 18175@debbugs.gnu.org
Subject: bug#18175: files.el: use mapc in (mapcar 'switch-to-buffer ...)
Date: Thu, 07 Aug 2014 15:29:03 -0400	[thread overview]
Message-ID: <jwviom46r1x.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <87ha1ot8kp.fsf@violet.siamics.net> (Ivan Shmakov's message of "Thu, 07 Aug 2014 19:15:34 +0000")

> 	I tend to disagree with that last part, – it seems like a common
> 	idiom for a function (or, generally, – a /form/; setq does that,
> 	for one thing) that’s used “solely” for its side-effects to
> 	return its “primary” argument, thus allowing for easy

Yes, it's common, but I strongly dislike it.

It's used often enough for `setq' that I consider it to be an exception.

In the case of `mapc' OTOH, I'm pretty sure 99.9% of Elisp coders have no
idea what is the return value of `mapc', so using this return value is
a kind of obfuscation.

> 	Yes.  However, I believe that the last two hunks of the one
> 	another variant of the diff (MIMEd) actually make the intent to
> 	return the reverse of the list returned by find-file-noselect
> 	/clearer,/ – although at the expense of adding one extra LoC in
> 	each case.

Agreed, and neither relies on the return value of `mapc', so those two
hunks are indeed good.  Please install them.


        Stefan





  reply	other threads:[~2014-08-07 19:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-02 21:55 bug#18175: files.el: use mapc in (mapcar 'switch-to-buffer ...) Ivan Shmakov
2014-08-03  0:55 ` Drew Adams
2014-08-03  8:55   ` Ivan Shmakov
2014-08-03 16:32     ` Drew Adams
2014-08-03 18:25       ` Ivan Shmakov
2014-08-03 18:43         ` Drew Adams
2014-08-06 17:26 ` Stefan Monnier
2014-08-07 19:15   ` Ivan Shmakov
2014-08-07 19:29     ` Stefan Monnier [this message]
2015-01-23 15:27       ` Ivan Shmakov

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

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

  git send-email \
    --in-reply-to=jwviom46r1x.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=18175@debbugs.gnu.org \
    --cc=ivan@siamics.net \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.