From: Richard Stallman <rms@gnu.org>
To: Michael Welsh Duggan <mwd@md5i.com>
Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: Lexical let and setq
Date: Sat, 14 Sep 2013 17:47:18 -0400 [thread overview]
Message-ID: <E1VKxgU-0000hU-J6@fencepost.gnu.org> (raw)
In-Reply-To: <878uz0e02m.fsf_-_@maru2.md5i.com> (message from Michael Welsh Duggan on Fri, 13 Sep 2013 20:09:05 -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
USA
www.fsf.org www.gnu.org
Skype: No way! That's nonfree (freedom-denying) software.
Use Ekiga or an ordinary phone call.
next prev parent reply other threads:[~2013-09-14 21:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <871u51ll93.fsf@yandex.ru>
[not found] ` <jwvzjrly386.fsf-monnier+emacs@gnu.org>
[not found] ` <jwvhadps8a1.fsf-monnier+emacs@gnu.org>
[not found] ` <0b29ebee-8ed4-47e2-816b-910a013a0898@default>
[not found] ` <jwvzjrhqrft.fsf-monnier+emacs@gnu.org>
2013-09-14 0:09 ` Lexical let and setq Michael Welsh Duggan
2013-09-14 3:46 ` Stefan Monnier
2013-09-14 11:13 ` Lars Magne Ingebrigtsen
2013-09-14 14:04 ` Pascal J. Bourguignon
2013-09-15 5:11 ` Stefan Monnier
2013-09-14 21:47 ` Richard Stallman [this message]
2013-09-15 5:09 ` Stefan Monnier
2013-09-15 16:54 ` Richard Stallman
2013-09-15 17:06 ` Stefan Monnier
2013-09-16 10:47 ` Richard Stallman
2013-09-16 15:59 Barry OReilly
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=E1VKxgU-0000hU-J6@fencepost.gnu.org \
--to=rms@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=mwd@md5i.com \
/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).