From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry Margolin Newsgroups: gmane.emacs.help Subject: Re: Emacs Lisp coding style question Date: Wed, 02 Jul 2014 11:20:37 -0400 Organization: A noiseless patient Spider Message-ID: References: <87mwcrudf5.fsf@kuiper.lan.informatimago.com> <87k37vykb2.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1404314734 7025 80.91.229.3 (2 Jul 2014 15:25:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 2 Jul 2014 15:25:34 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 02 17:25:25 2014 Return-path: Envelope-to: geh-help-gnu-emacs@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 1X2MPO-0007ri-Ob for geh-help-gnu-emacs@m.gmane.org; Wed, 02 Jul 2014 17:25:18 +0200 Original-Received: from localhost ([::1]:54592 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2MPO-0003ct-9X for geh-help-gnu-emacs@m.gmane.org; Wed, 02 Jul 2014 11:25:18 -0400 Original-Path: usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!news.stack.nl!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!barmar.motzarella.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 34 Injection-Info: barmar.motzarella.org; posting-host="2be9e9f5dd9af768b8861af71b85fc28"; logging-data="7134"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/qt5XvDKk0RkAQmZukzZDm" User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Cancel-Lock: sha1:GXNRsRGTkNIRkR9KZrJy5WuAcNs= Original-Xref: usenet.stanford.edu gnu.emacs.help:206243 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:98514 Archived-At: In article , Stefan Monnier wrote: > >>> But (without being able to give concrete examples right now) I noticed > >>> that advanced Lispers tend to call this 'C-style', consider the let > > I've never seen it referred to as "C-style". To me "C-style" would be > > (let (a b c d e) > (setq a (foo-a)) > (setq b (foo-b)) > ...) > > >>> What would be the recommended style for Emacs Lisp, or is this just a > >>> matter of taste? > > Mostly taste, and it depends on the specifics. I.e. it depends on > whether the intermediate names can be useful as code documentation, and > indentation issues may also tip the balance between the two. > > >> Notice that both code might compile to the exact same binary, so there's > >> no efficiency advantage in either. > > The Emacs Lisp implementation (both interpreted and compiled) is not > sophisticated enough to get the same efficiency out of the let-binding > version, actually. Root of all evil. Unless this code is in a heavily used inner loop, it probably won't make any significant difference. -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me ***