aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Pouar <pouar@pouar.net>2020-10-03 11:12:17 -0500
committerGravatar Pouar <pouar@pouar.net>2020-10-03 11:12:17 -0500
commit0c18b1edd6179181199e26fd670fa84e269055ff (patch)
treed0ee36d4ab083dbf73b94871c6269d925ffbc5f7
parentnot relevant anymore (diff)
can't believe I did that
-rw-r--r--core/util.lisp4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/util.lisp b/core/util.lisp
index 6fd2e79..180c6fc 100644
--- a/core/util.lisp
+++ b/core/util.lisp
@@ -137,4 +137,6 @@ argument.")
(defun random-from-range (from to)
(s:random-in-range from (1+ to)))
(define-compiler-macro random-from-range (from to)
- `(values (s:random-in-range ,from ,to)))
+ `(values (s:random-in-range ,from ,(if (constantp to)
+ (eval `(1+ ,to))
+ `(1+ ,to)))))