From 25609806f670b4e6a5ef0b132929c1f4f96ed100 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Mon, 16 Oct 2017 19:55:24 -0400 Subject: - Re-named "Vector" to "Sequence" to avoid confusion with mathematical vectors. --- stdlib/source/lux/data/format/json.lux | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'stdlib/source/lux/data/format/json.lux') diff --git a/stdlib/source/lux/data/format/json.lux b/stdlib/source/lux/data/format/json.lux index 7eac167e1..e00783c0b 100644 --- a/stdlib/source/lux/data/format/json.lux +++ b/stdlib/source/lux/data/format/json.lux @@ -15,7 +15,7 @@ [sum] [product] (coll [list "list/" Fold Monad] - [vector #+ Vector vector "vector/" Monad] + [sequence #+ Sequence sequence "sequence/" Monad] [dict #+ Dict])) [macro #+ Monad with-gensyms] (macro ["s" syntax #+ syntax:] @@ -38,13 +38,13 @@ (#Boolean Boolean) (#Number Number) (#String String) - (#Array (Vector JSON)) + (#Array (Sequence JSON)) (#Object (Dict String JSON))) (do-template [ ] [(type: #export )] - [Array (Vector JSON)] + [Array (Sequence JSON)] [Object (Dict String JSON)] ) @@ -75,7 +75,7 @@ (wrap (list (` (: JSON #Null)))) [_ (#;Tuple members)] - (wrap (list (` (: JSON (#Array (vector (~@ (list/map wrapper members)))))))) + (wrap (list (` (: JSON (#Array (sequence (~@ (list/map wrapper members)))))))) [_ (#;Record pairs)] (do Monad @@ -164,16 +164,16 @@ [#String text;Eq]) [(#Array xs) (#Array ys)] - (and (n.= (vector;size xs) (vector;size ys)) + (and (n.= (sequence;size xs) (sequence;size ys)) (list/fold (function [idx prev] (and prev (maybe;default false (do maybe;Monad - [x' (vector;nth idx xs) - y' (vector;nth idx ys)] + [x' (sequence;nth idx xs) + y' (sequence;nth idx ys)] (wrap (= x' y')))))) true - (list;indices (vector;size xs)))) + (list;indices (sequence;size xs)))) [(#Object xs) (#Object ys)] (and (n.= (dict;size xs) (dict;size ys)) @@ -288,7 +288,7 @@ [head any] (case head (#Array values) - (case (p;run (vector;to-list values) parser) + (case (p;run (sequence;to-list values) parser) (#E;Error error) (fail error) @@ -367,7 +367,7 @@ (def: (show-array show-json elems) (-> (-> JSON Text) (-> Array Text)) ($_ text/compose "[" - (|> elems (vector/map show-json) vector;to-list (text;join-with ",")) + (|> elems (sequence/map show-json) sequence;to-list (text;join-with ",")) "]")) (def: (show-object show-json object) @@ -490,7 +490,7 @@ _ (l;this )] (wrap ( elems))))] - [array~ Array "[" "]" (json~ []) vector;from-list] + [array~ Array "[" "]" (json~ []) sequence;from-list] [object~ Object "{" "}" (kv~ json~) (dict;from-list text;Hash)] ) -- cgit v1.2.3