aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/abstract
diff options
context:
space:
mode:
authorEduardo Julian2020-07-02 22:39:02 -0400
committerEduardo Julian2020-07-02 22:39:02 -0400
commit4bd2f378011bf28449ed907d637a7867524e3b4b (patch)
tree88ff726472fb1299a80470b78bbbefe248bd6d82 /stdlib/source/lux/abstract
parent7853d890ac72cd96851caedadd8525404705286c (diff)
Now using the new syntax for variants (even though they still work the old way... for now)
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux/abstract/enum.lux14
1 files changed, 9 insertions, 5 deletions
diff --git a/stdlib/source/lux/abstract/enum.lux b/stdlib/source/lux/abstract/enum.lux
index 9f074f7c5..9470cd142 100644
--- a/stdlib/source/lux/abstract/enum.lux
+++ b/stdlib/source/lux/abstract/enum.lux
@@ -12,10 +12,14 @@
(def: #export (range enum from to)
{#.doc "An inclusive [from, to] range of values."}
(All [a] (-> (Enum a) a a (List a)))
- (let [(^open "/@.") enum
- <= (order.<= /@&order)]
+ (let [(^open "/@.") enum]
(loop [end to
output #.Nil]
- (if (<= end from)
- (recur (/@pred end) (#.Cons end output))
- output))))
+ (cond (/@< end from)
+ (recur (/@pred end) (#.Cons end output))
+
+ (/@= end from)
+ (#.Cons end output)
+
+ ## else
+ output))))