[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: |
Mon, 25 Sep 2017 20:25:25 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
>> pure: like side-effect-free but additionally, the function always
>> returns the same value when called with the same arguments, so the
>> compiler can precompute the call if it knows the arguments.
> It may be necessary to define "same" more precisely.
> Does it mean equal? eq?
Both/neither? The compiler doesn't test it in any way (it only has the
known arguments, and no "others" to compare it with). I guess `equal`
is closer to what typically happens, but I don't think this precision is
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).
Stefan