unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Oleh Krehel <ohwoeowho@gmail.com>
Cc: Jordon Biondo <jordonbiondo@gmail.com>,
	emacs-devel@gnu.org, rms@gnu.org,
	Stefan Monnier <monnier@IRO.UMontreal.CA>
Subject: RE: giving `setq-local' the same signature as `setq'
Date: Thu, 19 Mar 2015 08:39:39 -0700 (PDT)	[thread overview]
Message-ID: <7455a7dd-8c32-4681-95a0-6d09f50ac169@default> (raw)
In-Reply-To: <87bnjp3tkv.fsf@gmail.com>

> > You do?  Pray tell, in what way is it a misfeature?  Nothing has
> > been said to elucidate this, so far - it has only been asserted.
> >
> > IMHO, it is a feature, giving users the choice.
> 
> Choice leads to inconsistency.

Bof.

http://en.wikipedia.org/wiki/Self-Reliance and search for "hobgoblin".

> I very much prefer the only-one-variable-per-setq style.

You're in luck then.  You have the choice. ;-)

You can do the same for `let*', if you like:

(let ((foo  fooval))
  (let ((phlop  phlopval))
    (let ((toto  totoval))
      ...)))

> It shows much more clearly where the variable is.

Where the variable is?  How so?  (Where is it?  Where's Waldo?)

> It also gives an anchor to quickly navigate to the variable
> to get its value.

How so?  Please elaborate.

> In a setq list of 10 items, by item 5 it is already unclear which is the
> variable and which is the value.  In my opinion, it's not worth
> complicating the code maintenance just to save a few chars.

This is why it is good that you have the choice.

I find it clearer to let `setq' do the grouping, instead of implicit or
explicit `progn'.  But I put each var & value pair on a separate line:

(setq foo    fooval
      phlop  phlopval  ; Maybe this one needs a comment.
      toto   totoval)

I don't do this to save characters (e.g. for typing).  I do it to make
the code clearer and maintenance less error prone and easier.  For me,
at least.



  reply	other threads:[~2015-03-19 15:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-18 15:26 giving `setq-local' the same signature as `setq' Jordon Biondo
2015-03-18 16:24 ` Stefan Monnier
2015-03-19 14:08   ` Richard Stallman
2015-03-19 14:48     ` Jordon Biondo
2015-03-19 15:11       ` Drew Adams
2015-03-19 15:17         ` Oleh Krehel
2015-03-19 15:39           ` Drew Adams [this message]
2015-03-19 15:55             ` Oleh Krehel
2015-03-19 17:25               ` Drew Adams

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=7455a7dd-8c32-4681-95a0-6d09f50ac169@default \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=jordonbiondo@gmail.com \
    --cc=monnier@IRO.UMontreal.CA \
    --cc=ohwoeowho@gmail.com \
    --cc=rms@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).