From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Maus Subject: Re: [PATCH 0/5] loop over headlines in active region Date: Sun, 28 Aug 2011 15:57:19 +0200 Message-ID: <87zkitabb4.wl%dmaus@ictsoc.de> References: <87obzpl3ec.fsf@gnu.org> <1314246334-5053-1-git-send-email-dmaus@ictsoc.de> <87d3ftiz11.fsf@gmail.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Sun_Aug_28_15:57:19_2011-1"; micalg=pgp-sha256; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:49480) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qxg1B-0006wB-2i for emacs-orgmode@gnu.org; Sun, 28 Aug 2011 10:07:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qxg19-0001Br-U1 for emacs-orgmode@gnu.org; Sun, 28 Aug 2011 10:07:21 -0400 Received: from app1b.xlhost.de ([213.202.242.162]:46260) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qxg19-0001Bn-Oq for emacs-orgmode@gnu.org; Sun, 28 Aug 2011 10:07:19 -0400 In-Reply-To: <87d3ftiz11.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: =?UTF-8?B?xaB0xJtww6FuIE7Em21lYw==?= Cc: David Maus , emacs-orgmode@gnu.org --pgp-sign-Multipart_Sun_Aug_28_15:57:19_2011-1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable At Thu, 25 Aug 2011 12:08:42 +0200, =C5=A0t=C4=9Bp=C3=A1n N=C4=9Bmec wrote: >=20 > On Thu, 25 Aug 2011 06:25:29 +0200 > David Maus wrote: >=20 > > As for the macro: What stop me to implement a macro for the generic > > operation is that for now the macro would depend on the global > > customization variable. That's not a problem per se but according to > > my readings about macros (mostly in context of Common Lisp, but that > > shouldn't matter) it should be considered bad style. >=20 > Could you expand on this a bit? As far as I can tell, you obviously > shouldn't depend on a customisation variable at macro expansion time, > but I don't see how depending on it at run time is any different from a > function doing the same. >=20 At expansion time the macro performs a transformation of the lisp at the place where the macro is used. At runtime the code of the expanded macro runs in the scope of the function where the macro was expanded into. A macro that uses a variable inside the expanded code that is not under its control (e.g. part of the argument list or gensym'd) is prone to introduce a bug caused by expanding the macro in an environment where this variable is not bound or used with a different semantics. In this particular case this should not be a problem indeed because we use a global dynamically scoped customization variable. Thus, whereever we would use the macro we can be sure the variable in the macro expansion is bound and carries the same meaning. Best, -- David --=20 OpenPGP... 0x99ADB83B5A4478E6 Jabber.... dmjena@jabber.org Email..... dmaus@ictsoc.de --pgp-sign-Multipart_Sun_Aug_28_15:57:19_2011-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iF4EABEIAAYFAk5aST8ACgkQma24O1pEeOZ/9gEAusTEEbKX6qOiZpUI996pfAsd 4VSHdYNnpsyYkGy8ufsBALIhsQB570yD73N1JF5fwK1D2fWQqX4kF6iF+uKN4qPq =7tQ/ -----END PGP SIGNATURE----- --pgp-sign-Multipart_Sun_Aug_28_15:57:19_2011-1--