emacs-devel
[Top][All Lists]
Advanced

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

Re: Byte compiler inefficiency


From: David Kastrup
Subject: Re: Byte compiler inefficiency
Date: Mon, 08 Aug 2005 14:20:09 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

"Richard M. Stallman" <address@hidden> writes:

>     The binding for x is completely unnecessary and wasteful.
>
> It is necessary in order for compiled code to do the same thing as
> the interpreted code.

No, unless by "same thing" you mean "equally inefficient" in which
case defsubst would need to be the same as defun.

> 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.

> Now, we could consider adopting the convention that it is ok for the
> compiled code not to work just like the interpreted code in this
> particular kind of case.

We are talking about "defsubst" here.  There are no guarantees
whatsoever that redefining functions like "car" and "cdr" subsequently
(and that is the only way that the binding could possibly have an
effect) will reflect back onto previously compiled versions of the
defsubst definition.

There _is_ no difference to the interpreted code: the temporary
binding has no possible effect: even if "car" or "cdr" throw an error
for which an error handler has been installed, the binding will have
been unwound before the error handler gets called.  The only instance
that could possibly see a difference would be the debugger.

But again: if you are worried about complete equivalence, defsubst can
never do anything better than defun.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

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