[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: optimizing defconst
From: |
Dan Nicolaescu |
Subject: |
Re: optimizing defconst |
Date: |
Sat, 27 Oct 2007 19:28:47 -0700 |
Stefan Monnier <address@hidden> writes:
> > (defconst viper-xemacs-p (featurep 'xemacs))
>
> > (defun foo()
> > (if viper-xemacs-p (error "Hmmmm")))
>
> > Shouldn't `foo' be optimized to just do nothing?
>
> Can't do it: some code might do (setq viper-xemacs-p t) before calling
> `foo'.
One can make the argument that we can also use the analogy with
defmacro. If a macro is redefined at run time, the compiled code does
not know about it. It's not far fetched to do the same about defconst.
I am not necessarily saying that we should make that change, but at
least it would be nice to have this documented in the docstring for
defconst.
- optimizing defconst, Dan Nicolaescu, 2007/10/27
- Re: optimizing defconst, Stefan Monnier, 2007/10/27
- Re: optimizing defconst,
Dan Nicolaescu <=
- Re: optimizing defconst, Richard Stallman, 2007/10/28
- Re: optimizing defconst, Kim F. Storm, 2007/10/29
- Re: optimizing defconst, Juanma Barranquero, 2007/10/29
- Re: optimizing defconst, Johan Bockgård, 2007/10/29
- Re: optimizing defconst, Davis Herring, 2007/10/29
- Re: optimizing defconst, Richard Stallman, 2007/10/29
Re: optimizing defconst, John Paul Wallington, 2007/10/27
Re: optimizing defconst, Kim F. Storm, 2007/10/27