From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.emacs.help Subject: Re: dynamic and lexical scope, attempted summary with example Date: Mon, 21 Jul 2014 06:44:46 +0200 Message-ID: <878unnpbgh.fsf@zigzag.favinet> References: <878unputvv.fsf@debian.uxu> <87bnsjsorp.fsf_-_@debian.uxu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1405917721 1533 80.91.229.3 (21 Jul 2014 04:42:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 21 Jul 2014 04:42:01 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jul 21 06:41:54 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 1X95QA-0002Oo-5F for geh-help-gnu-emacs@m.gmane.org; Mon, 21 Jul 2014 06:41:54 +0200 Original-Received: from localhost ([::1]:60620 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X95Q9-0001E9-JD for geh-help-gnu-emacs@m.gmane.org; Mon, 21 Jul 2014 00:41:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54635) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X95Pp-0001Dq-0h for help-gnu-emacs@gnu.org; Mon, 21 Jul 2014 00:41:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X95Ph-0000OL-Pf for help-gnu-emacs@gnu.org; Mon, 21 Jul 2014 00:41:32 -0400 Original-Received: from smtp206.alice.it ([82.57.200.102]:52859) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X95Ph-0000N4-G2 for help-gnu-emacs@gnu.org; Mon, 21 Jul 2014 00:41:25 -0400 Original-Received: from zigzag.favinet (79.51.73.13) by smtp206.alice.it (8.6.060.28) id 529A678F2BB3F393 for help-gnu-emacs@gnu.org; Mon, 21 Jul 2014 06:41:24 +0200 Original-Received: from ttn by zigzag.favinet with local (Exim 4.80) (envelope-from ) id 1X95T6-00022A-UP for help-gnu-emacs@gnu.org; Mon, 21 Jul 2014 06:44:56 +0200 In-Reply-To: <87bnsjsorp.fsf_-_@debian.uxu> (Emanuel Berg's message of "Sun, 20 Jul 2014 23:28:58 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 82.57.200.102 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:98850 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable () Emanuel Berg () Sun, 20 Jul 2014 23:28:58 +0200 (defun shortcut-to-file (key-prefix key file-prefix file) "Make shortcut with key KEY-PREFIX KEY to FILE-PREFIX FILE." (global-set-key (format "%s%s" key-prefix key) `(lambda () (interactive) (do-show-file (format "%s%s" ,file-prefix ,file)) ))) Is this correct? It is if it does what the designer desires. :-D I find =E2=80=98(format "%s%s" A B)=E2=80=99 unbeautiful, personally. 2. At the 7th, last line, `file-prefix' and `file' appears. Those are preceded by commas so, in combination with the backtick, their values will be inserted - hard-coded. This bypasses the whole problem because it eliminates all evaluation of symbols (it is like Caesar and the Gordian knot). The drawback is that the lambda can't be byte-compiled as it is formally "just" a list. I think using terms "insert" and "hard-coded" is confusing in this context. Also, "eliminated" is imprecise and thus misleading. To bake a cake, do you eliminate the flour? =2D-=20 Thien-Thi Nguyen GPG key: 4C807502 (if you're human and you know it) read my lisp: (responsep (questions 'technical) (not (via 'mailing-list))) =3D> nil --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlPMmsIACgkQZwMiJEyAdQKJDgCfdnbI6hNkqTq9Ad7JFwQYAJFw L+MAoMSRiF0K7ORhku1/LthKGUPybsWj =GnPS -----END PGP SIGNATURE----- --=-=-=--