emacs-devel
[Top][All Lists]
Advanced

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

Re: byte compiling defcustom


From: Richard Stallman
Subject: Re: byte compiling defcustom
Date: Thu, 15 Nov 2007 23:28:17 -0500

    (defvar foo     (if (featurep 'xemacs) 'bar 'baz) "doc")
    (defcustom foo1 (if (featurep 'xemacs) 'bar 'baz) "doc")


    Are compiled to:

    (defvar foo 'baz (#$ . 543))
    (custom-declare-variable 'foo1 '(if (featurep 'xemacs) 'bar 'baz) '(#$ . 
581))

The initial value expression for defcustom is saved and gets
recalculated later in some cases.  So it cannot in general be
optimized.

This particular simplification could be done even in defcustom, since
(featurep 'xemacs) is effectively a constant.  But why bother
to implement that optimization?  It works fine as it is now.





reply via email to

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