From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: phillip.lord@newcastle.ac.uk (Phillip Lord) Newsgroups: gmane.emacs.help Subject: Re: DynamicBindingVsLexicalBinding Date: Wed, 16 Oct 2013 13:57:38 +0100 Message-ID: <87vc0x9xvh.fsf@zerg32.ncl.ac.uk> References: <52598D4A.2010901@easy-emacs.de> <871u3qjq0j.fsf@yandex.ru> <525A51BD.5040903@easy-emacs.de> <525AA42B.6030006@gmx.net> <6d5df021-be1e-40a2-966a-548a7ee9deb3@default> <87txgk85em.fsf@zerg32.ncl.ac.uk> <525C62D9.8070702@gmx.net> <87ppr6oju7.fsf@zerg32.ncl.ac.uk> <525DA8E6.8070607@gmx.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1381928283 10128 80.91.229.3 (16 Oct 2013 12:58:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 16 Oct 2013 12:58:03 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Kai =?utf-8?Q?Gro=C3=9Fjohann?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 16 14:58:07 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 1VWQfu-0001Ol-K6 for geh-help-gnu-emacs@m.gmane.org; Wed, 16 Oct 2013 14:58:06 +0200 Original-Received: from localhost ([::1]:47128 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWQfu-0005Th-5F for geh-help-gnu-emacs@m.gmane.org; Wed, 16 Oct 2013 08:58:06 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40902) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWQfe-0005TZ-2r for help-gnu-emacs@gnu.org; Wed, 16 Oct 2013 08:57:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VWQfY-0000hy-4D for help-gnu-emacs@gnu.org; Wed, 16 Oct 2013 08:57:50 -0400 Original-Received: from cheviot12.ncl.ac.uk ([128.240.234.12]:51318) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWQfX-0000hc-RU for help-gnu-emacs@gnu.org; Wed, 16 Oct 2013 08:57:44 -0400 Original-Received: from smtpauth-vm.ncl.ac.uk ([10.8.233.129]) by cheviot12.ncl.ac.uk with esmtp (Exim 4.63) (envelope-from ) id 1VWQfT-0003gZ-Ap; Wed, 16 Oct 2013 13:57:39 +0100 Original-Received: from localhost (zerg32.ncl.ac.uk [10.66.65.18]) (authenticated bits=0) by smtpauth-vm.ncl.ac.uk (8.13.8/8.13.8) with ESMTP id r9GCvclg010126 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 16 Oct 2013 13:57:38 +0100 In-Reply-To: <525DA8E6.8070607@gmx.net> ("Kai \=\?utf-8\?Q\?Gro\=C3\=9Fjohann\=22\?\= \=\?utf-8\?Q\?'s\?\= message of "Tue, 15 Oct 2013 22:43:18 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 128.240.234.12 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:94036 Archived-At: Kai Gro=C3=9Fjohann writes: > Phillip Lord wrote: >>=20 >> None the less, I think you are hitting a strawman here; if Emacs went >> entirely lexically bound, I don't think that it necessarily follows that >> elisp will turn into Java. > > Sorry, Phil, that's not what I meant. I think I got carried away a > little there. Not at all. It was very poetic! > Even if Emacs were to move to Guile: Scheme has fluid-let. > > All I wanted to point out is that this idea of dynamic binding is more > powerful than one might think at first. Perhaps my understanding is not complete, but I always thought that dynamic and static binding was about variables that are unbound. If we have global variables with mutable state, then as far as I can see, you could do something equivalent with either. So, this... (defun perldoc () (interactive) (require 'man) (let ((manual-program "perldoc")) (call-interactively 'man))) is nearly equivalent to=20 (defun perldoc() (interactive) (require 'man) (let ((old manual-program)) (setq manual-program "perldoc") (call-interactively 'man) (setq manual-program old)) If we were multi-threaded, then AFAICT, the let version would be cleaner -- as the altered manual-program is *only* in the dynamic environment of the call to the perldoc command. So another call to the man function would be unaffected. While the second changes global state, and then changes it back. But, we aren't. Phil