emacs-devel
[Top][All Lists]
Advanced

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

Re: pure-fns in byte-opt.el


From: Stefan Monnier
Subject: Re: pure-fns in byte-opt.el
Date: Sat, 25 Jul 2020 15:58:54 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>> of any use.  The only *real* definition is the last part: "the compiler
>> can precompute the call if it knows the arguments" (where "can" should
>> probably be replaced with "may", actually).
> That's not a very useful definition, though, or rather, not a
> definition at all, but a consequence of an as-yet hidden definition.

I don't see why you think so.

> It has to be possible to decide whether a function is pure by looking
> at its observable behavior and its definition.

The above "definition" seems to allow that: based on looking at the code
you should be able to assess whether it's safe to allow the compiler (or
anything else for that matter) to precompute the call.

> The behavior of the byte compiled needs to follow
> from the definition, not the other way round.

I don't see how the above definition fails this constraint.


        Stefan




reply via email to

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