diff options
author | Maxime Devos <maximedevos@telenet.be> | 2021-05-16 20:32:34 +0200 |
---|---|---|
committer | Daniel Llorens <lloda@sarc.name> | 2021-05-18 13:42:34 +0200 |
commit | 221203b0df6420b0b8e7678fab7d056325364731 (patch) | |
tree | 17d5f31622ed9a7b638f1976edf7f1631275e312 | |
parent | fd5cb457fb3a450b4b14eb89c8dbd764ba8df52e (diff) | |
download | guile-221203b0df6420b0b8e7678fab7d056325364731.tar.gz |
Add ‘expt’ to the list of effect-free primitives.
I find myself writing code like (- (expt 2 32) 1)
lately. Let's allow constant-folding that.
* module/language/tree-il/primitives.scm
(*interesting-primitive-names*, *effect-free-primitives*):
Add 'expt'.
-rw-r--r-- | module/language/tree-il/primitives.scm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/module/language/tree-il/primitives.scm b/module/language/tree-il/primitives.scm index 1cc7907a8..7f3746b4f 100644 --- a/module/language/tree-il/primitives.scm +++ b/module/language/tree-il/primitives.scm @@ -48,6 +48,7 @@ memq memv = < > <= >= zero? positive? negative? + * - / 1- 1+ quotient remainder modulo exact->inexact + expt ash logand logior logxor lognot logtest logbit? sqrt abs floor ceiling sin cos tan asin acos atan not @@ -171,7 +172,7 @@ `(values eq? eqv? equal? = < > <= >= zero? positive? negative? - ash logand logior logxor lognot logtest logbit? + expt ash logand logior logxor lognot logtest logbit? + * - / 1- 1+ sqrt abs quotient remainder modulo exact->inexact floor ceiling sin cos tan asin acos atan not |