From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.help Subject: Re: hooks and let-bound variables Date: Wed, 24 Jun 2015 17:48:08 +0200 Message-ID: <20150624154807.GA5965@tuxteam.de> References: <96506ece-5bd9-4750-8abd-128c77cf6c39@default> <8eccbda9-800d-403f-ad79-35554153db17@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; x-action=pgp-signed X-Trace: ger.gmane.org 1435160915 18729 80.91.229.3 (24 Jun 2015 15:48:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Jun 2015 15:48:35 +0000 (UTC) Cc: Alan Schmitt , help-gnu-emacs@gnu.org To: Drew Adams Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 24 17:48:35 2015 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 1Z7muf-0007Xz-U9 for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Jun 2015 17:48:34 +0200 Original-Received: from localhost ([::1]:51442 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7muf-00008n-Ad for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Jun 2015 11:48:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38567) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7muR-00008b-Sd for help-gnu-emacs@gnu.org; Wed, 24 Jun 2015 11:48:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7muO-0001VC-Jh for help-gnu-emacs@gnu.org; Wed, 24 Jun 2015 11:48:19 -0400 Original-Received: from mail.tuxteam.de ([5.199.139.25]:36887 helo=tomasium.tuxteam.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7muO-0001SD-Eg for help-gnu-emacs@gnu.org; Wed, 24 Jun 2015 11:48:16 -0400 Original-Received: from tomas by tomasium.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1Z7muG-0001bh-2W; Wed, 24 Jun 2015 17:48:08 +0200 In-Reply-To: <8eccbda9-800d-403f-ad79-35554153db17@default> User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 5.199.139.25 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:105127 Archived-At: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wed, Jun 24, 2015 at 07:44:33AM -0700, Drew Adams wrote: > > I find very funny that I only use languages with lexical binding, > > but can still be bitten by it in emacs-lisp. > > ;-) > > Yup. If you have only lexical binding then you cannot be bitten > by it (or by dynamic binding). > > Emacs makes (good) use of dynamic binding, for exactly the kind > of thing you were doing: let-binding around some code whose behavior > you want to change by way of the binding. > > In most languages you do not ever want the behavior of existing code > to change at runtime by just changing the value of a global variable > (i.e, from outside that code). With Common Lisp and Emacs Lisp you > do sometimes want that. Perl is another language with dual binding: it started out with "local" (dynamically bound, in good ol' shell tradition) and then grew (I think it's an appropriate term for Perl ;-) "my" for lexical binding, with all the niceness of closures, etc. Then, loads of well-meant advice ("never use 'local', you want 'my'"). I think a language having both is a very nice trait. - -- t -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlWK0TcACgkQBcgs9XrR2kYXwwCfV6wP6C6nUaMgSKH0D7RFjEsH tUEAnAxjn/I0YgjWz36tjLsBCh4QgLWY =0mcS -----END PGP SIGNATURE-----