emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] New convenience macros


From: Stefan Monnier
Subject: Re: [PATCH] New convenience macros
Date: Thu, 23 Aug 2007 15:12:09 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

>>> (if (and (featurep 'simple) (featurep 'xemacs)) a b)
>>> warns about free variables for both `a' and `b'.  So I think having the

>> That's a valid criticism, but I fail to see how your macros would fare any
>> better on the above kind of code.  I.e. what code would you write instead of
>> the above, using your macros?

>   (or (do-in-xemacs (when (featurep 'simple) a)) b)

Aka (or (if (featurep 'xemacs) (when (featurep 'simple) a)) b)
which would naturally be rewritten as

   (if (and (featurep 'xemacs) (featurep 'simple)) a b)

>   (with-emacs-type 'xemacs (when (featurep 'simple) a))
>   (with-emacs-type 'emacs b)

(if (featurep 'xemacs) (when (featurep 'simple) a))
(unless (featurep 'xemacs) b)
which would naturally be rewritten as

   (if (featurep 'xemacs) (when (featurep 'simple) a) b)

> Both only warn about `b' and the resulting bytecode has no mention of
> `a'.

Same for my alternatives, which are the most obvious translations of
your code.  Note that the macro form is never simpler or clearer.
So I really fail to see the value of those macros.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]