diff options
author | Eduardo Julian | 2022-02-11 19:57:00 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-02-11 19:57:00 -0400 |
commit | 105ab334201646be6b594d3d1215297e3b629a10 (patch) | |
tree | d1f972d5fe676f8b93f4efa8fb0a8ce602878903 /stdlib/source/library/lux/abstract/enum.lux | |
parent | 469b171e5793422a4dbd27f4f2fab8a261c9ccf9 (diff) |
Fixed directive extensions for Lux/Python.
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})))) |