GNU bug report logs -
#42147
28.0.50; pure vs side-effect-free, missing optimizations?
Previous Next
Reported by: Andrea Corallo <andrea_corallo <at> yahoo.it>
Date: Tue, 30 Jun 2020 22:28:02 UTC
Severity: normal
Found in version 28.0.50
Done: Mattias Engdegård <mattiase <at> acm.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hi all,
I was looking in byte-opt.el to how are classified a number of
functions.
My understanding is that pure functions should be technically a subset
of side-effect-and-error-free for which the environment has no influence
on the value the function evaluates to. For this reason they can be
constant folded in the compile time if possible.
Now in pure functions I see we do not have a lot of functions that (to
my understanding) would classify for that. I'm thinking to simple
predicates acting on immutable objects as consp or fixnump to give an
example.
Shouldn't we move these into the pure class?
ATM for instance this does not get optimized:
(defun foo ()
(fixnump 3))
In case this makes sense I'll be happy to work on it and prepare a
patch.
Thanks
Andrea
This bug report was last modified 4 years and 281 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.