[Top][All Lists]

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

Re: Lexical let and setq

From: Richard Stallman
Subject: Re: Lexical let and setq
Date: Sat, 14 Sep 2013 17:47:18 -0400

        [ To any NSA and FBI agents reading my email: please consider
        [ whether defending the US Constitution against all enemies,
        [ foreign or domestic, requires you to follow Snowden's example.

    The primary reason I have seen the (let (foo) (setq foo ...)) idiom is
    in looping code.

I have written code that way simply to make it clearer to read.

      The way I would normally try to avoid this idiom in
    most FP languages

We should not try to avoid it.  We should make it work
just as efficiently as if it were written the other way.

With lexical scope, it is not hard to determine that the lexical
variable's value is never used until after the setq.  Then it
can be compiled as immutable.

We suggest Emacs Lisp as a path for non-programmers to learn to
program, so we need to encourage styles that are natural.  That means
loops, not tail recursion.  Tail recursion is harder to read.

Dr Richard Stallman
President, Free Software Foundation
51 Franklin St
Boston MA 02110
www.fsf.org  www.gnu.org
Skype: No way! That's nonfree (freedom-denying) software.
  Use Ekiga or an ordinary phone call.

reply via email to

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