[Top][All Lists]

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

Re: pathological byte-compilation

From: Miles Bader
Subject: Re: pathological byte-compilation
Date: 25 Jun 2002 10:51:33 +0900

"Stefan Monnier" <monnier+gnu/address@hidden> writes:
>       (defsubst values (&rest values)
>         (apply 'list values))
> in other words, the same result as if we had compiled
> (defun foo () (let ((values (list 1))) (apply 'list values)))

Of course, part of the problem is that defsubst is rather pathetic, in
that it retains the argument bindings no matter what.

A very long time ago I wrote an elisp function that analyzes `let' forms
and rewrites them to eliminate as many bindings as possible (e.g., when
it can substitute a variable's initialization value in the places where
the variable is used, without changing any side-effects).

That transformation assumed a `lexical style' use of `let', which isn't
something you can do generally, but in the case of defsubst, I think it
would probably be safe to say that argument bindings are not guaranteed
to be visible (via dynamic binding) in functions called from defsubt

Such an optimization might greatly improve the results of using defsubst...

.Numeric stability is probably not all that important when you're guessing.

reply via email to

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