diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux.lux | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/stdlib/source/lux.lux b/stdlib/source/lux.lux index 4f6a134a4..9365e0cda 100644 --- a/stdlib/source/lux.lux +++ b/stdlib/source/lux.lux @@ -4145,13 +4145,13 @@ temp)) ))) -(def: (zip2 xs ys) +(def: (zip/2 xs ys) (All [a b] (-> (List a) (List b) (List [a b]))) (case xs (#Cons x xs') (case ys (#Cons y ys') - (list& [x y] (zip2 xs' ys')) + (list& [x y] (zip/2 xs' ys')) _ (list)) @@ -4248,7 +4248,7 @@ #None (wrap enhanced-target)))) target - (zip2 locals members))] + (zip/2 locals members))] (wrap (` ({(~ pattern) (~ enhanced-target)} (~ (identifier$ source))))))))) name tags&members body)] (wrap (list full-body))))) @@ -4278,18 +4278,18 @@ _ (fail "Wrong syntax for cond")))) -(def: (enumerate' idx xs) +(def: (enumeration' idx xs) (All [a] (-> Nat (List a) (List [Nat a]))) (case xs (#Cons x xs') - (#Cons [idx x] (enumerate' ("lux i64 +" 1 idx) xs')) + (#Cons [idx x] (enumeration' ("lux i64 +" 1 idx) xs')) #Nil #Nil)) -(def: (enumerate xs) +(def: (enumeration xs) (All [a] (-> (List a) (List [Nat a]))) - (enumerate' 0 xs)) + (enumeration' 0 xs)) (macro: #export (get@ tokens) {#.doc (text$ ($_ "lux text concat" @@ -4318,7 +4318,7 @@ (if ("lux i64 =" idx r-idx) g!output g!_)])) - (zip2 tags (enumerate members))))] + (zip/2 tags (enumeration members))))] (return (list (` ({(~ pattern) (~ g!output)} (~ record)))))) _ @@ -4347,7 +4347,7 @@ g!_ (gensym "g!_") #let [g!output (local-identifier$ short) pattern (|> tags - enumerate + enumeration (list@map (function (_ [tag-idx tag]) (if ("lux i64 =" my-tag-index tag-idx) g!output @@ -4361,7 +4361,7 @@ (: (-> [Nat Name Type] (Meta (List Code))) (function (_ [sub-tag-index sname stype]) (open-field alias tags' sub-tag-index sname source+ stype))) - (enumerate (zip2 tags' members')))] + (enumeration (zip/2 tags' members')))] (return (list@join decls'))) _ @@ -4396,7 +4396,7 @@ [decls' (monad@map meta-monad (: (-> [Nat Name Type] (Meta (List Code))) (function (_ [tag-index sname stype]) (open-field alias tags tag-index sname source stype))) - (enumerate (zip2 tags members)))] + (enumeration (zip/2 tags members)))] (return (list@join decls'))) _ @@ -4632,7 +4632,7 @@ (do meta-monad [g!slot (gensym "")] (return [r-slot-name r-idx g!slot])))) - (zip2 tags (enumerate members)))] + (zip/2 tags (enumeration members)))] (let [pattern (record$ (list@map (: (-> [Name Nat Code] [Code Code]) (function (_ [r-slot-name r-idx r-var]) [(tag$ r-slot-name) @@ -4661,7 +4661,7 @@ (: (-> Code (Meta Code)) (function (_ _) (gensym "temp"))) slots) - #let [pairs (zip2 slots bindings) + #let [pairs (zip/2 slots bindings) update-expr (list@fold (: (-> [Code Code] Code Code) (function (_ [s b] v) (` (..set@ (~ s) (~ v) (~ b))))) @@ -4719,7 +4719,7 @@ (do meta-monad [g!slot (gensym "")] (return [r-slot-name r-idx g!slot])))) - (zip2 tags (enumerate members)))] + (zip/2 tags (enumeration members)))] (let [pattern (record$ (list@map (: (-> [Name Nat Code] [Code Code]) (function (_ [r-slot-name r-idx r-var]) [(tag$ r-slot-name) |