From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Pascal J. Bourguignon" Newsgroups: gmane.emacs.help Subject: Re: sending function arguments to recursive function calls Date: Tue, 07 May 2013 16:32:50 +0200 Organization: Informatimago Message-ID: <87d2t2uagd.fsf@kuiper.lan.informatimago.com> References: <0F54256BD7B94384AC4DDA919D502C20@us.oracle.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1367937233 8053 80.91.229.3 (7 May 2013 14:33:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 7 May 2013 14:33:53 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue May 07 16:33:53 2013 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 1UZixk-0006N5-Er for geh-help-gnu-emacs@m.gmane.org; Tue, 07 May 2013 16:33:52 +0200 Original-Received: from localhost ([::1]:33910 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZixk-0007fl-2S for geh-help-gnu-emacs@m.gmane.org; Tue, 07 May 2013 10:33:52 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34020) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZivW-0005I4-JF for help-gnu-emacs@gnu.org; Tue, 07 May 2013 10:31:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UZivU-0002hN-Tt for help-gnu-emacs@gnu.org; Tue, 07 May 2013 10:31:34 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:34313) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZivU-0002hE-NY for help-gnu-emacs@gnu.org; Tue, 07 May 2013 10:31:32 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UZivQ-0004Es-NG for help-gnu-emacs@gnu.org; Tue, 07 May 2013 16:31:28 +0200 Original-Received: from amontsouris-651-1-14-160.w90-46.abo.wanadoo.fr ([90.46.105.160]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 07 May 2013 16:31:28 +0200 Original-Received: from pjb by amontsouris-651-1-14-160.w90-46.abo.wanadoo.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 07 May 2013 16:31:28 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 36 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: amontsouris-651-1-14-160.w90-46.abo.wanadoo.fr Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:MjVjZDIzMmZlNTQ3ZDA4OGI2YjkyZmRlY2IzYTM5MTczOTc1NzJlMQ== X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:90537 Archived-At: Gauthier Östervall writes: > On Sat, May 4, 2013 at 5:30 PM, Drew Adams wrote: >> The key to the puzzle is this little declaration in the first comment of the >> file: >> >> ;;; face-remap.el --- Functions for ... -*- lexical-binding: t -*- >> >> That `lexical-binding t' tells Emacs that the code in this file is meant to be >> understood with the variable `lexical-binding' bound to t (locally). > > Thanks for the kind words and the explanation. I do not feel very > confident about having a function that relies on a file scope setting > of lexical-binding, which as in this case happens 300 lines earlier. > Wouldn't it be better to have functions that work whatever the value > of lexical-binding, if possible? > >> An alternative to using a lexical binding here would be to simply use this: >> >> `(lambda () (interactive) (text-scale-adjust (abs ',inc))) > > If this alternative works whatever lexical-binding, it seems superior > to me. Isn't it? No, it is inferior. Here, you have to duplicate the code of the function for each occurence. With closures (lexical binding) you only need to duplicate the enclosed environment, the code of the function being the same for all the closures. -- __Pascal Bourguignon__ http://www.informatimago.com/ A bad day in () is better than a good day in {}.