[Top][All Lists]

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

RE: giving `setq-local' the same signature as `setq'

From: Drew Adams
Subject: RE: giving `setq-local' the same signature as `setq'
Date: Thu, 19 Mar 2015 08:39:39 -0700 (PDT)

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


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

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