emacs-devel
[Top][All Lists]
Advanced

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

Re: multi-assignment setq [was: setq's with missing final arguments.]


From: Oleh Krehel
Subject: Re: multi-assignment setq [was: setq's with missing final arguments.]
Date: Mon, 23 Nov 2015 08:58:48 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Drew Adams <address@hidden> writes:

>> but multi-variable setq is just plain bad: it makes LISP less
>> lispy that it should be. For example: "(setq bar)" is a nice
>> sexp: you can delete it, copy it, comment it, move it around
>
> That quality is not what I consider "lispiness".  That same
> complaint applies to `let*' and a zillion other Lisp veterans.

By "lispiness" I mean the sexp structure that allows you to manipulate
code in a foolproof way and navigate it easier. That sexp structure also
applies to `let*', but doesn't apply for example to Clojure's `let'.

For example of being foolproof, exchanging the order of two `setq'
statements is a well defined, simple to automate operation. You can pull
it off with `transpose-sexps' if you position the point just
right. Alternatively, `kill-sexp' when positioned before the open paren
can also work for this.

On the other hand, multi-assignment setq isn't foolproof. You have to
count from sexp's start and make sure that you kill/paste starting from
the odd numbered list child and not from the even numbered. It's a
hassle that can easily be avoided. Using single-assignment setq adds
only 6 chars per assignment, compared to multi-assignment setq and:

- it reads better
- it navigates better (`forward-list' and `backward-list')
- it manipulates better



reply via email to

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