From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: Lexical let and setq Date: Sat, 14 Sep 2013 17:47:18 -0400 Message-ID: References: <871u51ll93.fsf@yandex.ru> <0b29ebee-8ed4-47e2-816b-910a013a0898@default> <878uz0e02m.fsf_-_@maru2.md5i.com> Reply-To: rms@gnu.org NNTP-Posting-Host: plane.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: ger.gmane.org 1379195241 7474 80.91.229.3 (14 Sep 2013 21:47:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 14 Sep 2013 21:47:21 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Michael Welsh Duggan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 14 23:47:25 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VKxga-0000np-Ez for ged-emacs-devel@m.gmane.org; Sat, 14 Sep 2013 23:47:24 +0200 Original-Received: from localhost ([::1]:54650 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKxga-0008TU-21 for ged-emacs-devel@m.gmane.org; Sat, 14 Sep 2013 17:47:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32782) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKxgW-0008TM-RW for emacs-devel@gnu.org; Sat, 14 Sep 2013 17:47:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VKxgV-0001gz-W6 for emacs-devel@gnu.org; Sat, 14 Sep 2013 17:47:20 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50049) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKxgV-0001gk-TG for emacs-devel@gnu.org; Sat, 14 Sep 2013 17:47:19 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1VKxgU-0000hU-J6; Sat, 14 Sep 2013 17:47:18 -0400 In-reply-to: <878uz0e02m.fsf_-_@maru2.md5i.com> (message from Michael Welsh Duggan on Fri, 13 Sep 2013 20:09:05 -0400) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:163350 Archived-At: [ 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.