"Richard M. Stallman" <[EMAIL PROTECTED]> writes:

>     > When cadr is called interpretively, the binding of x is like
>     > any other binding.
>
>     Sure, but the binding can't possible have any effect on the
>     result.
>
> In the particular case of cadr, it can't, because no non-primitive
> functions are called.  If the compiler could detect this kind of
> case, it could do the optimization safely.
>
> However, if the defsubst calls some non-primitives, they could refer
> to the variable, so failing to bind it would be unsafe.

Probably it would make sense to put a property on functions that are
known not to depend on external bindings.  The byte compiler could
even propagate this property to functions like cadr.

> Implementing the optimization in the former case would be useful,
> and I will put it in etc/TODO, but it should not be done until after
> the release.

Thanks.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

Reply via email to