[Q] #'featurep byte-optimisation

Michael Sperber sperber at informatik.uni-tuebingen.de
Tue Sep 4 03:49:48 EDT 2007


Steve Youngs <steve at sxemacs.org> writes:

> * Michael Sperber <sperber at informatik.uni-tuebingen.de> writes:
>
>   > Generally, the change seems fine.  But do we really need to use regexps
>   > for this kind of thing?
>
> The regexp was the only way I could think of to have it work for both
> the standard #'featurep use (featurep 'foo), and the
> advanced... (featurep '(or foo bar))

Ah, I hadn't know about that.  Does it do the right thing for, say,

(featurep '(and undefined-feature sxemacs))

?  (My experiments suggest that it doesn't, but maybe I'm again not
understanding this right.)

>   > (defvar features-always-true '(xemacs sxemacs))
>   > ...
>   > (defun byte-optimize-featurep (form)
>   >    (if (and (consp (cdr form))
>   >             (eq? 'quote (cadr form))
>   >             (consp (cddr form))
>   >             (memq (caddr form) features-always-true))
>   >      ...))
>
> Wouldn't that return t even on XEmacs for (featurep 'sxemacs)?

Told you :-) I would think a small interpreter for the featurep language
is needed.  I'll be happy to write it if it's the right thing to do.

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla



More information about the XEmacs-Patches mailing list