[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [PATCH 0/5] loop over headlines in active region
From: |
David Maus |
Subject: |
Re: [O] [PATCH 0/5] loop over headlines in active region |
Date: |
Sun, 28 Aug 2011 15:57:19 +0200 |
User-agent: |
Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.8 Emacs/23.2 (i486-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) |
At Thu, 25 Aug 2011 12:08:42 +0200,
Štěpán Němec wrote:
>
> On Thu, 25 Aug 2011 06:25:29 +0200
> David Maus wrote:
>
> > 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.
>
> 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.
>
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
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... address@hidden
Email..... address@hidden
pgpxvaBL9KzC1.pgp
Description: PGP signature
- Re: [O] New feature: loop over siblings for some commands, David Maus, 2011/08/10
- Re: [O] New feature: loop over siblings for some commands, David Maus, 2011/08/12
- Re: [O] New feature: loop over siblings for some commands, Bastien, 2011/08/16
- [O] [PATCH 0/5] loop over headlines in active region, David Maus, 2011/08/25
- Re: [O] [PATCH 0/5] loop over headlines in active region, Carsten Dominik, 2011/08/25
- Re: [O] [PATCH 0/5] loop over headlines in active region, David Maus, 2011/08/28
- Re: [O] [PATCH 0/5] loop over headlines in active region, Carsten Dominik, 2011/08/29
- Re: [O] [PATCH 0/5] loop over headlines in active region, David Maus, 2011/08/30
- Re: [O] [PATCH 0/5] loop over headlines in active region, Štěpán Němec, 2011/08/25
- Re: [O] [PATCH 0/5] loop over headlines in active region,
David Maus <=
- [O] [PATCH 1/5] Extend scope 'region to include body of last headline in active region, David Maus, 2011/08/25
- Re: [O] [PATCH 1/5] Extend scope 'region to include body of last headline in active region, Carsten Dominik, 2011/08/25
- Re: [O] [PATCH 1/5] Extend scope 'region to include body of last headline in active region, David Maus, 2011/08/30
- [O] [PATCH 2/5] Immediately return if scope is region but no region is active, David Maus, 2011/08/25
- Re: [O] [PATCH 2/5] Immediately return if scope is region but no region is active, Carsten Dominik, 2011/08/25
- Re: [O] [PATCH 2/5] Immediately return if scope is region but no region is active, David Maus, 2011/08/28
- Re: [O] [PATCH 2/5] Immediately return if scope is region but no region is active, Carsten Dominik, 2011/08/29
- Re: [O] [PATCH 2/5] Immediately return if scope is region but no region is active, David Maus, 2011/08/30
- [O] [PATCH 3/5] New customization variable: Loop over headlines in active region, David Maus, 2011/08/25
- [O] [PATCH 4/5] Skip invisible headlines when mapping over headlines in active region, David Maus, 2011/08/25