emacs-devel
[Top][All Lists]
Advanced

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

Re: byte compiling defcustom


From: Luc Teirlinck
Subject: Re: byte compiling defcustom
Date: Mon, 19 Nov 2007 14:44:39 -0600 (CST)

   I don't see any major flaws with that, but I think it is cleaner
   to show the expression precisely as it was in the source code.

Indeed.  If the byte compiler would change the Lisp code in a way that
represents an improvement, then the Lisp code in the source should be
changed.

Moreover, this would represent much added complexity and risk for
negligible benefit.  Due to various keywords, defcustoms are way more
complex than defvars.  Their value is not necessarily evaluated in the
context of the file (e.g `custom-initialize-safe-set') and the
:initialize or :set function could even not evaluate it at all, or
evaluate it in a non-standard way.  So the potential for bugs in the
automatic optimization would be very non-trivial.

It seems clear that in terms of actual optimization,any gains would be
neglegible and the main reason to compile would be to emit warnings.
To me, no change seems necessary, but if the lack of warnings worries
people, can the compiler not just warn about, say, obsolete variables
and such without _changing_ anything about the code, leaving this up
to the author or maintainer.

Sincerely,

Luc.





reply via email to

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