bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#18175: files.el: use mapc in (mapcar 'switch-to-buffer ...)


From: Stefan Monnier
Subject: bug#18175: files.el: use mapc in (mapcar 'switch-to-buffer ...)
Date: Thu, 07 Aug 2014 15:29:03 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

>       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 via email to

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