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: Tue, 15 Oct 2013 12:27:12 +0100 Message-ID: <87ppr6oju7.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> 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 1381836458 31511 80.91.229.3 (15 Oct 2013 11:27:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Oct 2013 11:27:38 +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 Tue Oct 15 13:27:43 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 1VW2mo-0001Nw-80 for geh-help-gnu-emacs@m.gmane.org; Tue, 15 Oct 2013 13:27:38 +0200 Original-Received: from localhost ([::1]:41166 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VW2mn-0007gS-Ix for geh-help-gnu-emacs@m.gmane.org; Tue, 15 Oct 2013 07:27:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41669) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VW2mZ-0007fU-If for help-gnu-emacs@gnu.org; Tue, 15 Oct 2013 07:27:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VW2mU-0007No-9w for help-gnu-emacs@gnu.org; Tue, 15 Oct 2013 07:27:23 -0400 Original-Received: from cheviot22.ncl.ac.uk ([128.240.234.22]:38554) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VW2mU-0007LE-0o for help-gnu-emacs@gnu.org; Tue, 15 Oct 2013 07:27:18 -0400 Original-Received: from smtpauth-vm.ncl.ac.uk ([10.8.233.129]) by cheviot22.ncl.ac.uk with esmtp (Exim 4.63) (envelope-from ) id 1VW2mP-0004E5-Er; Tue, 15 Oct 2013 12:27:13 +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 r9FBRDWr012676 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 15 Oct 2013 12:27:13 +0100 In-Reply-To: <525C62D9.8070702@gmx.net> ("Kai \=\?utf-8\?Q\?Gro\=C3\=9Fjohann\=22\?\= \=\?utf-8\?Q\?'s\?\= message of "Mon, 14 Oct 2013 23:32:09 +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.22 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:94021 Archived-At: Kai Gro=C3=9Fjohann writes: > Here is a nice and straightforward application of dynamic binding (if I > do say so myself). > > (defun perldoc () > (interactive) > (require 'man) > (let ((manual-program "perldoc")) > (call-interactively 'man))) It is a nice example, and I've done something similar myself (on smtpauth, and w3 if I remember). > Of course a REAL developer would provide a manual reader class with > configurable manual reader class factories, and then use a dependency > injection container to implement a configurable manual reader class > factory factory. And because convention over configuration is a good > thing, we'll say that the ManManualReaderFactory creates "man" manual > readers whereas the PerldocManualReaderFactory creates "perldoc" manual > readers. So you can write a manual reader factory factory generator > that just generates an empty subclass of the > AbstractManualReaderFactoryBase at runtime. Yeah. That would be great. > You would even only need a few hundred lines of code to do it. And the > Spring dependency injection container to go with it is only a couple MB. > What's not to like about this? What? The Emacs Lisp solution is only > five lines of code you say? How can this _possibly_ provide the same > functionality that we've got with our awesome enterprisey framework? > Hm? Dynamic binding? You must be kidding! Like this class which is a bit of a classic. http://docs.spring.io/spring/docs/2.5.x/api/org/springframework/aop/framewo= rk/AbstractSingletonProxyFactoryBean.html and has been described as everything wrong with Java in a single class. 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. Phil