diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/library/lux/abstract/enum.lux | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/stdlib/source/library/lux/abstract/enum.lux b/stdlib/source/library/lux/abstract/enum.lux index 45026abc1..f136fc92d 100644 --- a/stdlib/source/library/lux/abstract/enum.lux +++ b/stdlib/source/library/lux/abstract/enum.lux @@ -1,8 +1,8 @@ (.using - [library - [lux "*"]] - [// - ["[0]" order {"+" Order}]]) + [library + [lux "*"]] + [// + ["[0]" order {"+" Order}]]) (type: .public (Enum e) (Interface @@ -12,14 +12,15 @@ (def: .public (range enum from to) (All (_ a) (-> (Enum a) a a (List a))) - (let [(^open "[0]") enum] + (let [(^open "/#[0]") enum] (loop [end to - output {.#End}] - (cond (< end from) - (again (pred end) {.#Item end output}) + output (`` (: (List (~~ (:of from))) + {.#End}))] + (cond (/#< end from) + (again (/#pred end) {.#Item end output}) - (< from end) - (again (succ end) {.#Item end output}) + (/#< from end) + (again (/#succ end) {.#Item end output}) ... (= end from) {.#Item end output})))) |