summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Devos <maximedevos@telenet.be>2021-05-16 20:32:34 +0200
committerDaniel Llorens <lloda@sarc.name>2021-05-18 13:42:34 +0200
commit221203b0df6420b0b8e7678fab7d056325364731 (patch)
tree17d5f31622ed9a7b638f1976edf7f1631275e312
parentfd5cb457fb3a450b4b14eb89c8dbd764ba8df52e (diff)
downloadguile-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.scm3
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