aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library
diff options
context:
space:
mode:
authorEduardo Julian2021-09-08 23:14:59 -0400
committerEduardo Julian2021-09-08 23:14:59 -0400
commit085c9a6ef151531cb01b842ed2f4366a49b78367 (patch)
tree01d5671061f1c688fe74319196f8da0e8aa95e4c /stdlib/source/library
parent54ab659064990ff37a9234c9792102a3b88277d6 (diff)
De-bracing | part 2
Diffstat (limited to 'stdlib/source/library')
-rw-r--r--stdlib/source/library/lux.lux27
-rw-r--r--stdlib/source/library/lux/abstract/apply.lux4
-rw-r--r--stdlib/source/library/lux/control/concatenative.lux84
-rw-r--r--stdlib/source/library/lux/control/concurrency/atom.lux32
-rw-r--r--stdlib/source/library/lux/control/concurrency/thread.lux20
-rw-r--r--stdlib/source/library/lux/control/thread.lux4
-rw-r--r--stdlib/source/library/lux/control/writer.lux4
-rw-r--r--stdlib/source/library/lux/data/binary.lux44
-rw-r--r--stdlib/source/library/lux/data/collection/array.lux24
-rw-r--r--stdlib/source/library/lux/data/collection/list.lux8
-rw-r--r--stdlib/source/library/lux/data/collection/row.lux8
-rw-r--r--stdlib/source/library/lux/data/collection/tree/zipper.lux12
-rw-r--r--stdlib/source/library/lux/data/text.lux16
-rw-r--r--stdlib/source/library/lux/data/text/buffer.lux24
-rw-r--r--stdlib/source/library/lux/data/text/encoding/utf8.lux12
-rw-r--r--stdlib/source/library/lux/debug.lux14
-rw-r--r--stdlib/source/library/lux/math.lux4
-rw-r--r--stdlib/source/library/lux/program.lux4
-rw-r--r--stdlib/source/library/lux/target/jvm/constant.lux4
-rw-r--r--stdlib/source/library/lux/target/jvm/loader.lux4
-rw-r--r--stdlib/source/library/lux/target/python.lux8
-rw-r--r--stdlib/source/library/lux/time/instant.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/default/platform.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/js.lux2
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lua.lux6
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/php.lux6
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/python.lux13
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/ruby.lux6
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/scheme.lux6
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/common.lux2
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/runtime.lux8
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/runtime.lux2
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/reference.lux8
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux2
-rw-r--r--stdlib/source/library/lux/type.lux3
-rw-r--r--stdlib/source/library/lux/type/check.lux3
-rw-r--r--stdlib/source/library/lux/world/console.lux4
-rw-r--r--stdlib/source/library/lux/world/file.lux4
-rw-r--r--stdlib/source/library/lux/world/file/watch.lux4
-rw-r--r--stdlib/source/library/lux/world/net/http/client.lux4
-rw-r--r--stdlib/source/library/lux/world/program.lux24
-rw-r--r--stdlib/source/library/lux/world/shell.lux4
42 files changed, 253 insertions, 227 deletions
diff --git a/stdlib/source/library/lux.lux b/stdlib/source/library/lux.lux
index d10f8d2f5..0872e57c1 100644
--- a/stdlib/source/library/lux.lux
+++ b/stdlib/source/library/lux.lux
@@ -4868,15 +4868,34 @@
(in_meta (list pick))
(target_pick target options' default)))))
+(def: (pairs' tokens)
+ (-> (List Code) (Maybe (List [Code Code])))
+ (if (|> tokens
+ list\size
+ (n/% 2)
+ ("lux i64 =" 0))
+ (#Some (pairs tokens))
+ #None))
+
(macro: .public (for tokens)
(do meta_monad
[target ..target]
(case tokens
- (^ (list [_ (#Record options)]))
- (target_pick target options #None)
+ (^ (list [_ (#Tuple options)]))
+ (case (pairs' options)
+ (#Some options)
+ (target_pick target options #None)
+
+ #None
+ (failure (..wrong_syntax_error (name_of ..for))))
- (^ (list [_ (#Record options)] default))
- (target_pick target options (#Some default))
+ (^ (list [_ (#Tuple options)] default))
+ (case (pairs' options)
+ (#Some options)
+ (target_pick target options (#Some default))
+
+ #None
+ (failure (..wrong_syntax_error (name_of ..for))))
_
(failure (..wrong_syntax_error (name_of ..for))))))
diff --git a/stdlib/source/library/lux/abstract/apply.lux b/stdlib/source/library/lux/abstract/apply.lux
index 48598dfa5..f1b2b9344 100644
--- a/stdlib/source/library/lux/abstract/apply.lux
+++ b/stdlib/source/library/lux/abstract/apply.lux
@@ -26,10 +26,10 @@
(def: (on fgx fgf)
... TODO: Switch from this version to the one below (in comments) ASAP.
- (for {@.old (let [fgf' (\ f_apply on
+ (for [@.old (let [fgf' (\ f_apply on
fgf
(\ f_monad in (function (_ gf gx) (\ g_apply on gx gf))))]
- (:expected (\ f_apply on (:expected fgx) (:expected fgf'))))}
+ (:expected (\ f_apply on (:expected fgx) (:expected fgf'))))]
(let [fgf' (\ f_apply on
fgf
(\ f_monad in (function (_ gf gx) (\ g_apply on gx gf))))]
diff --git a/stdlib/source/library/lux/control/concatenative.lux b/stdlib/source/library/lux/control/concatenative.lux
index 24883f901..28a48035f 100644
--- a/stdlib/source/library/lux/control/concatenative.lux
+++ b/stdlib/source/library/lux/control/concatenative.lux
@@ -38,8 +38,7 @@
(Parser (List Alias))
(|> (<>.and <code>.local_identifier <code>.any)
<>.some
- <code>.record
- (<>.else (list))))
+ <code>.tuple))
(def: top^
(Parser (List Code))
@@ -75,9 +74,12 @@
(meta.failure (format "Cannot expand to more than a single AST/Code node:" text.new_line
(|> expansion (list\each %.code) (text.interposed " ")))))))
-(syntax: .public (=> [aliases aliases^
- inputs stack^
- outputs stack^])
+(def: signature^
+ (Parser [(List Alias) Stack Stack])
+ (<>.either ($_ <>.and aliases^ stack^ stack^)
+ ($_ <>.and (<>\in (list)) stack^ stack^)))
+
+(syntax: .public (=> [[aliases inputs outputs] signature^])
(let [de_alias (function (_ aliased)
(list\mix (function (_ [from to] pre)
(code.replaced (code.local_identifier from) to pre))
@@ -248,26 +250,26 @@
)
(def: .public if
- (All (_ ___a ___z)
- (=> {then (=> ___a ___z)
- else (=> ___a ___z)}
- ___a [Bit then else] ___z))
+ (All (_ ,,,0 ,,,1)
+ (=> [then (=> ,,,0 ,,,1)
+ else (=> ,,,0 ,,,1)]
+ ,,,0 [Bit then else] ,,,1))
(function (_ [[[stack test] then] else])
(.if test
(then stack)
(else stack))))
(def: .public call
- (All (_ ___a ___z)
- (=> {quote (=> ___a ___z)}
- ___a [quote] ___z))
+ (All (_ ,,,0 ,,,1)
+ (=> [quote (=> ,,,0 ,,,1)]
+ ,,,0 [quote] ,,,1))
(function (_ [stack quote])
(quote stack)))
(def: .public loop
- (All (_ ___)
- (=> {test (=> ___ ___ [Bit])}
- ___ [test] ___))
+ (All (_ ,,,)
+ (=> [test (=> ,,, ,,, [Bit])]
+ ,,, [test] ,,,))
(function (loop [stack pred])
(let [[stack' verdict] (pred stack)]
(.if verdict
@@ -275,34 +277,34 @@
stack'))))
(def: .public dip
- (All (_ ___ a)
- (=> ___ [a (=> ___ ___)]
- ___ [a]))
+ (All (_ ,,, a)
+ (=> ,,, [a (=> ,,, ,,,)]
+ ,,, [a]))
(function (_ [[stack a] quote])
[(quote stack) a]))
(def: .public dip/2
- (All (_ ___ a b)
- (=> ___ [a b (=> ___ ___)]
- ___ [a b]))
+ (All (_ ,,, a b)
+ (=> ,,, [a b (=> ,,, ,,,)]
+ ,,, [a b]))
(function (_ [[[stack a] b] quote])
[[(quote stack) a] b]))
(def: .public do
- (All (_ ___a ___z)
- (=> {body (=> ___a ___z)
- pred (=> ___z ___a [Bit])}
- ___a [pred body]
- ___z [pred body]))
+ (All (_ ,,,0 ,,,1)
+ (=> [body (=> ,,,0 ,,,1)
+ pred (=> ,,,1 ,,,0 [Bit])]
+ ,,,0 [pred body]
+ ,,,1 [pred body]))
(function (_ [[stack pred] body])
[[(body stack) pred] body]))
(def: .public while
- (All (_ ___a ___z)
- (=> {body (=> ___z ___a)
- pred (=> ___a ___z [Bit])}
- ___a [pred body]
- ___z))
+ (All (_ ,,,0 ,,,1)
+ (=> [body (=> ,,,1 ,,,0)
+ pred (=> ,,,0 ,,,1 [Bit])]
+ ,,,0 [pred body]
+ ,,,1))
(function (while [[stack pred] body])
(let [[stack' verdict] (pred stack)]
(.if verdict
@@ -310,24 +312,24 @@
stack'))))
(def: .public compose
- (All (_ ___a ___ ___z)
- (=> [(=> ___a ___) (=> ___ ___z)]
- [(=> ___a ___z)]))
+ (All (_ ,,,0 ,,, ,,,1)
+ (=> [(=> ,,,0 ,,,) (=> ,,, ,,,1)]
+ [(=> ,,,0 ,,,1)]))
(function (_ [[stack f] g])
[stack (|>> f g)]))
(def: .public partial
- (All (_ ___a ___z a)
- (=> ___a [a (=> ___a [a] ___z)]
- ___a [(=> ___a ___z)]))
+ (All (_ ,,,0 ,,,1 a)
+ (=> ,,,0 [a (=> ,,,0 [a] ,,,1)]
+ ,,,0 [(=> ,,,0 ,,,1)]))
(function (_ [[stack arg] quote])
[stack (|>> (push arg) quote)]))
(word: .public when
- (All (_ ___)
- (=> {body (=> ___ ___)}
- ___ [Bit body]
- ___))
+ (All (_ ,,,)
+ (=> [body (=> ,,, ,,,)]
+ ,,, [Bit body]
+ ,,,))
swap
(push ..call)
(push ..drop)
diff --git a/stdlib/source/library/lux/control/concurrency/atom.lux b/stdlib/source/library/lux/control/concurrency/atom.lux
index 6309f4f35..091273281 100644
--- a/stdlib/source/library/lux/control/concurrency/atom.lux
+++ b/stdlib/source/library/lux/control/concurrency/atom.lux
@@ -20,57 +20,57 @@
(new [a])
(get [] a)
(compareAndSet [a a] boolean)]))]
- (for {@.old <jvm>
- @.jvm <jvm>}
+ (for [@.old <jvm>
+ @.jvm <jvm>]
(as_is)))
-(with_expansions [<new> (for {@.js "js array new"
+(with_expansions [<new> (for [@.js "js array new"
@.python "python array new"
@.lua "lua array new"
@.ruby "ruby array new"
@.php "php array new"
- @.scheme "scheme array new"}
+ @.scheme "scheme array new"]
(as_is))
- <write> (for {@.js "js array write"
+ <write> (for [@.js "js array write"
@.python "python array write"
@.lua "lua array write"
@.ruby "ruby array write"
@.php "php array write"
- @.scheme "scheme array write"}
+ @.scheme "scheme array write"]
(as_is))
- <read> (for {@.js "js array read"
+ <read> (for [@.js "js array read"
@.python "python array read"
@.lua "lua array read"
@.ruby "ruby array read"
@.php "php array read"
- @.scheme "scheme array read"}
+ @.scheme "scheme array read"]
(as_is))]
(abstract: .public (Atom a)
(with_expansions [<jvm> (java/util/concurrent/atomic/AtomicReference a)]
- (for {@.old <jvm>
- @.jvm <jvm>}
+ (for [@.old <jvm>
+ @.jvm <jvm>]
(array.Array a)))
[(def: .public (atom value)
(All (_ a) (-> a (Atom a)))
(:abstraction (with_expansions [<jvm> (java/util/concurrent/atomic/AtomicReference::new value)]
- (for {@.old <jvm>
- @.jvm <jvm>}
+ (for [@.old <jvm>
+ @.jvm <jvm>]
(<write> 0 value (<new> 1))))))
(def: .public (read! atom)
(All (_ a) (-> (Atom a) (IO a)))
(io.io (with_expansions [<jvm> (java/util/concurrent/atomic/AtomicReference::get (:representation atom))]
- (for {@.old <jvm>
- @.jvm <jvm>}
+ (for [@.old <jvm>
+ @.jvm <jvm>]
(<read> 0 (:representation atom))))))
(def: .public (compare_and_swap! current new atom)
(All (_ a) (-> a a (Atom a) (IO Bit)))
(io.io (with_expansions [<jvm> (java/util/concurrent/atomic/AtomicReference::compareAndSet current new (:representation atom))]
- (for {@.old <jvm>
- @.jvm <jvm>}
+ (for [@.old <jvm>
+ @.jvm <jvm>]
(let [old (<read> 0 (:representation atom))]
(if (same? old current)
(exec (<write> 0 new (:representation atom))
diff --git a/stdlib/source/library/lux/control/concurrency/thread.lux b/stdlib/source/library/lux/control/concurrency/thread.lux
index 4e82d76a6..c9430c1ed 100644
--- a/stdlib/source/library/lux/control/concurrency/thread.lux
+++ b/stdlib/source/library/lux/control/concurrency/thread.lux
@@ -45,7 +45,7 @@
["[1]::[0]"
(new [int])
(schedule [java/lang/Runnable long java/util/concurrent/TimeUnit] "io" (java/util/concurrent/ScheduledFuture java/lang/Object))]))]
- (for {@.old (as_is <jvm>)
+ (for [@.old (as_is <jvm>)
@.jvm (as_is <jvm>)
@.js
@@ -55,7 +55,7 @@
(ffi.import: threading/Timer
["[1]::[0]"
(new [ffi.Float ffi.Function])
- (start [] "io" "?" Any)])}
+ (start [] "io" "?" Any)])]
... Default
(type: Thread
@@ -70,18 +70,18 @@
(with_expansions [<jvm> (|> (java/lang/Runtime::getRuntime)
(java/lang/Runtime::availableProcessors)
.nat)]
- (for {@.old <jvm>
- @.jvm <jvm>}
+ (for [@.old <jvm>
+ @.jvm <jvm>]
... Default
1)))
(with_expansions [<jvm> (as_is (def: runner
java/util/concurrent/ScheduledThreadPoolExecutor
(java/util/concurrent/ScheduledThreadPoolExecutor::new (.int ..parallelism))))]
- (for {@.old <jvm>
+ (for [@.old <jvm>
@.jvm <jvm>
@.js (as_is)
- @.python (as_is)}
+ @.python (as_is)]
... Default
(def: runner
@@ -111,7 +111,7 @@
0 (java/util/concurrent/Executor::execute runnable runner)
_ (java/util/concurrent/ScheduledThreadPoolExecutor::schedule runnable (.int milli_seconds) java/util/concurrent/TimeUnit::MILLISECONDS
runner))))]
- (for {@.old <jvm>
+ (for [@.old <jvm>
@.jvm <jvm>
@.js
@@ -124,7 +124,7 @@
[(|> milli_seconds n.frac (f./ +1,000.0))]
threading/Timer::new
(threading/Timer::start []))]
- (in []))}
+ (in []))]
... Default
(do [! io.monad]
@@ -135,10 +135,10 @@
..runner)]
(in [])))))
-(for {@.old (as_is)
+(for [@.old (as_is)
@.jvm (as_is)
@.js (as_is)
- @.python (as_is)}
+ @.python (as_is)]
... Default
(as_is (exception: .public cannot_continue_running_threads)
diff --git a/stdlib/source/library/lux/control/thread.lux b/stdlib/source/library/lux/control/thread.lux
index b2945a7a0..ec49d9a1a 100644
--- a/stdlib/source/library/lux/control/thread.lux
+++ b/stdlib/source/library/lux/control/thread.lux
@@ -30,7 +30,7 @@
(def: .public (read! box)
(All (_ ! a) (-> (Box ! a) (Thread ! a)))
(function (_ !)
- (for {@.old
+ (for [@.old
("jvm aaload" (:representation box) 0)
@.jvm
@@ -46,7 +46,7 @@
@.lua ("lua array read" 0 (:representation box))
@.ruby ("ruby array read" 0 (:representation box))
@.php ("php array read" 0 (:representation box))
- @.scheme ("scheme array read" 0 (:representation box))})))
+ @.scheme ("scheme array read" 0 (:representation box))])))
(def: .public (write! value box)
(All (_ a) (-> a (All (_ !) (-> (Box ! a) (Thread ! Any)))))
diff --git a/stdlib/source/library/lux/control/writer.lux b/stdlib/source/library/lux/control/writer.lux
index cabc9268c..0805da036 100644
--- a/stdlib/source/library/lux/control/writer.lux
+++ b/stdlib/source/library/lux/control/writer.lux
@@ -62,9 +62,9 @@
(def: (conjoint MlMla)
(do monad
- [[l1 Mla] (for {@.old
+ [[l1 Mla] (for [@.old
(: ((:parameter 1) (Writer (:parameter 0) ((:parameter 1) (Writer (:parameter 0) (:parameter 2)))))
- MlMla)}
+ MlMla)]
... On new compiler
MlMla)
[l2 a] Mla]
diff --git a/stdlib/source/library/lux/data/binary.lux b/stdlib/source/library/lux/data/binary.lux
index 8d1975b8f..33bac997b 100644
--- a/stdlib/source/library/lux/data/binary.lux
+++ b/stdlib/source/library/lux/data/binary.lux
@@ -60,12 +60,12 @@
(def: byte
(-> (I64 Any) (primitive "java.lang.Byte"))
- (for {@.old
+ (for [@.old
(|>> .int ffi.long_to_byte)
@.jvm
- (|>> .int (:as (primitive "java.lang.Long")) ffi.long_to_byte)})))]
- (for {@.old (as_is <jvm>)
+ (|>> .int (:as (primitive "java.lang.Long")) ffi.long_to_byte)])))]
+ (for [@.old (as_is <jvm>)
@.jvm (as_is <jvm>)
@.js
@@ -92,14 +92,14 @@
(ffi.import: (make-bytevector [Nat] Binary))
(ffi.import: (bytevector-u8-ref [Binary Nat] I64))
(ffi.import: (bytevector-u8-set! [Binary Nat (I64 Any)] Any))
- (ffi.import: (bytevector-length [Binary] Nat)))}
+ (ffi.import: (bytevector-length [Binary] Nat)))]
... Default
(type: .public Binary
(array.Array (I64 Any)))))
(template: (!size binary)
- [(for {@.old (ffi.length binary)
+ [(for [@.old (ffi.length binary)
@.jvm (ffi.length binary)
@.js
@@ -113,13 +113,13 @@
"python array length")
@.scheme
- (..bytevector-length [binary])}
+ (..bytevector-length [binary])]
... Default
(array.size binary))])
(template: (!read index binary)
- [(for {@.old (..i64 (ffi.read! index binary))
+ [(for [@.old (..i64 (ffi.read! index binary))
@.jvm (..i64 (ffi.read! index binary))
@.js
@@ -136,7 +136,7 @@
("python array read" index))
@.scheme
- (..bytevector-u8-ref [binary index])}
+ (..bytevector-u8-ref [binary index])]
... Default
(|> binary
@@ -152,13 +152,13 @@
(:as ..Binary))])
(template: (!write index value binary)
- [(for {@.old (ffi.write! index (..byte value) binary)
+ [(for [@.old (ffi.write! index (..byte value) binary)
@.jvm (ffi.write! index (..byte value) binary)
@.js (!!write .Frac n.frac "js array write" index value binary)
@.python (!!write (I64 Any) (:as (I64 Any)) "python array write" index value binary)
@.scheme (exec (..bytevector-u8-set! [binary index value])
- binary)}
+ binary)]
... Default
(array.write! index (|> value .nat (n.% (hex "100"))) binary))])
@@ -169,7 +169,7 @@
(def: .public (empty size)
(-> Nat Binary)
- (for {@.old (ffi.array byte size)
+ (for [@.old (ffi.array byte size)
@.jvm (ffi.array byte size)
@.js
@@ -181,7 +181,7 @@
(:as Binary))
@.scheme
- (..make-bytevector size)}
+ (..make-bytevector size)]
... Default
(array.empty size)))
@@ -261,7 +261,7 @@
(def: .public (write/64! index value binary)
(-> Nat (I64 Any) Binary (Try Binary))
(if (n.< (..!size binary) (n.+ 7 index))
- (for {@.scheme (let [write_high (|>> (!write index (i64.right_shifted 56 value))
+ (for [@.scheme (let [write_high (|>> (!write index (i64.right_shifted 56 value))
(!write (n.+ 1 index) (i64.right_shifted 48 value))
(!write (n.+ 2 index) (i64.right_shifted 40 value))
(!write (n.+ 3 index) (i64.right_shifted 32 value)))
@@ -269,7 +269,7 @@
(!write (n.+ 5 index) (i64.right_shifted 16 value))
(!write (n.+ 6 index) (i64.right_shifted 8 value))
(!write (n.+ 7 index) value))]
- (|> binary write_high write_low #try.Success))}
+ (|> binary write_high write_low #try.Success))]
(#try.Success (|> binary
(!write index (i64.right_shifted 56 value))
(!write (n.+ 1 index) (i64.right_shifted 48 value))
@@ -286,8 +286,8 @@
(def: (= reference sample)
(with_expansions [<jvm> (java/util/Arrays::equals reference sample)]
- (for {@.old <jvm>
- @.jvm <jvm>}
+ (for [@.old <jvm>
+ @.jvm <jvm>]
(let [limit (!size reference)]
(and (n.= limit
(!size sample))
@@ -298,8 +298,8 @@
(recur (++ index)))
true))))))))
-(for {@.old (as_is)
- @.jvm (as_is)}
+(for [@.old (as_is)
+ @.jvm (as_is)]
... Default
(exception: .public (cannot_copy_bytes [bytes Nat
@@ -315,8 +315,8 @@
(with_expansions [<jvm> (as_is (do try.monad
[_ (java/lang/System::arraycopy source (.int source_offset) target (.int target_offset) (.int bytes))]
(in target)))]
- (for {@.old <jvm>
- @.jvm <jvm>}
+ (for [@.old <jvm>
+ @.jvm <jvm>]
... Default
(let [source_input (n.- source_offset (!size source))
@@ -338,8 +338,8 @@
(if (n.> size limit)
(exception.except ..slice_out_of_bounds [size offset length])
(with_expansions [<jvm> (as_is (#try.Success (java/util/Arrays::copyOfRange binary (.int offset) (.int limit))))]
- (for {@.old <jvm>
- @.jvm <jvm>}
+ (for [@.old <jvm>
+ @.jvm <jvm>]
... Default
(..copy length offset binary 0 (..empty length)))))))
diff --git a/stdlib/source/library/lux/data/collection/array.lux b/stdlib/source/library/lux/data/collection/array.lux
index 3c04a7d7f..0bd99245d 100644
--- a/stdlib/source/library/lux/data/collection/array.lux
+++ b/stdlib/source/library/lux/data/collection/array.lux
@@ -27,17 +27,17 @@
(with_expansions [<index_type> (primitive "java.lang.Long")
<elem_type> (primitive "java.lang.Object")
<array_type> (type (Array <elem_type>))]
- (for {@.jvm
+ (for [@.jvm
(template: (!int value)
[(|> value
(:as <index_type>)
"jvm object cast"
- "jvm conversion long-to-int")])}
+ "jvm conversion long-to-int")])]
(as_is))
(def: .public (empty size)
(All (_ a) (-> Nat (Array a)))
- (for {@.old
+ (for [@.old
(:expected ("jvm anewarray" "(java.lang.Object )" size))
@.jvm
@@ -52,11 +52,11 @@
@.lua ("lua array new" size)
@.ruby ("ruby array new" size)
@.php ("php array new" size)
- @.scheme ("scheme array new" size)}))
+ @.scheme ("scheme array new" size)]))
(def: .public (size array)
(All (_ a) (-> (Array a) Nat))
- (for {@.old
+ (for [@.old
("jvm arraylength" array)
@.jvm
@@ -73,7 +73,7 @@
@.lua ("lua array length" array)
@.ruby ("ruby array length" array)
@.php ("php array length" array)
- @.scheme ("scheme array length" array)}))
+ @.scheme ("scheme array length" array)]))
(template: (!read! <read!> <null?>)
[(let [output (<read!> index array)]
@@ -85,7 +85,7 @@
(All (_ a)
(-> Nat (Array a) (Maybe a)))
(if (n.< (size array) index)
- (for {@.old
+ (for [@.old
(let [value ("jvm aaload" array index)]
(if ("jvm object null?" value)
#.None
@@ -104,13 +104,13 @@
@.lua (!read! "lua array read" "lua object nil?")
@.ruby (!read! "ruby array read" "ruby object nil?")
@.php (!read! "php array read" "php object null?")
- @.scheme (!read! "scheme array read" "scheme object nil?")})
+ @.scheme (!read! "scheme array read" "scheme object nil?")])
#.None))
(def: .public (write! index value array)
(All (_ a)
(-> Nat a (Array a) (Array a)))
- (for {@.old
+ (for [@.old
("jvm aastore" array index value)
@.jvm
@@ -124,13 +124,13 @@
@.lua ("lua array write" index value array)
@.ruby ("ruby array write" index value array)
@.php ("php array write" index value array)
- @.scheme ("scheme array write" index value array)}))
+ @.scheme ("scheme array write" index value array)]))
(def: .public (delete! index array)
(All (_ a)
(-> Nat (Array a) (Array a)))
(if (n.< (size array) index)
- (for {@.old
+ (for [@.old
(write! index (:expected ("jvm object null")) array)
@.jvm
@@ -141,7 +141,7 @@
@.lua ("lua array delete" index array)
@.ruby ("ruby array delete" index array)
@.php ("php array delete" index array)
- @.scheme ("scheme array delete" index array)})
+ @.scheme ("scheme array delete" index array)])
array))
)
diff --git a/stdlib/source/library/lux/data/collection/list.lux b/stdlib/source/library/lux/data/collection/list.lux
index ead69db05..286290c96 100644
--- a/stdlib/source/library/lux/data/collection/list.lux
+++ b/stdlib/source/library/lux/data/collection/list.lux
@@ -203,7 +203,7 @@
(def: .public (all check xs)
(All (_ a b)
(-> (-> a (Maybe b)) (List a) (List b)))
- (for {... TODO: Stop relying on this ASAP.
+ (for [... TODO: Stop relying on this ASAP.
@.js
(mix (function (_ head tail)
(case (check head)
@@ -213,7 +213,7 @@
#.None
tail))
#.End
- (reversed xs))}
+ (reversed xs))]
(case xs
#.End
#.End
@@ -572,9 +572,9 @@
(do [! monad]
[lMla MlMla
... TODO: Remove this version ASAP and use one below.
- lla (for {@.old
+ lla (for [@.old
(: ((:parameter 0) (List (List (:parameter 1))))
- (monad.all ! lMla))}
+ (monad.all ! lMla))]
(monad.all ! lMla))]
(in (..together lla)))))
diff --git a/stdlib/source/library/lux/data/collection/row.lux b/stdlib/source/library/lux/data/collection/row.lux
index 5080c4c1c..728a67ce4 100644
--- a/stdlib/source/library/lux/data/collection/row.lux
+++ b/stdlib/source/library/lux/data/collection/row.lux
@@ -224,9 +224,9 @@
... If so, a brand-new root must be established, that is
... 1-level taller.
(|> row
- (with@ #root (|> (for {@.old
+ (with@ #root (|> (for [@.old
(: (Hierarchy (:parameter 0))
- (empty_hierarchy []))}
+ (empty_hierarchy []))]
(empty_hierarchy []))
(array.write! 0 (#Hierarchy (value@ #root row)))
(array.write! 1 (..path (value@ #level row) (value@ #tail row)))))
@@ -293,9 +293,9 @@
(#try.Success (if (n.< (tail_off row_size) idx)
(revised@ #root (hierarchy\has (value@ #level row) idx val)
row)
- (revised@ #tail (for {@.old
+ (revised@ #tail (for [@.old
(: (-> (Base (:parameter 0)) (Base (:parameter 0)))
- (|>> array.clone (array.write! (branch_idx idx) val)))}
+ (|>> array.clone (array.write! (branch_idx idx) val)))]
(|>> array.clone (array.write! (branch_idx idx) val)))
row)))
(exception.except ..index_out_of_bounds [row idx]))))
diff --git a/stdlib/source/library/lux/data/collection/tree/zipper.lux b/stdlib/source/library/lux/data/collection/tree/zipper.lux
index 36b162843..ee7daa341 100644
--- a/stdlib/source/library/lux/data/collection/tree/zipper.lux
+++ b/stdlib/source/library/lux/data/collection/tree/zipper.lux
@@ -103,13 +103,13 @@
(do maybe.monad
[family (value@ #family zipper)]
(in (let [(^slots [#parent #lefts #rights]) family]
- (for {@.old
+ (for [@.old
(revised@ #node (: (-> (Tree (:parameter 0))
(Tree (:parameter 0)))
(with@ #//.children (list\composite (list.reversed lefts)
(#.Item (value@ #node zipper)
rights))))
- parent)}
+ parent)]
(with@ [#node #//.children]
(list\composite (list.reversed lefts)
(#.Item (value@ #node zipper)
@@ -123,11 +123,11 @@
(#.Some family)
(case (value@ <side> family)
(#.Item next side')
- (#.Some (for {@.old
+ (#.Some (for [@.old
[#family (#.Some (|> family
(with@ <side> side')
(revised@ <op_side> (|>> (#.Item (value@ #node zipper))))))
- #node next]}
+ #node next]]
(let [move (: (All (_ a) (-> (List (Tree a)) (Zipper a) (Family Zipper a) (Family Zipper a)))
(function (_ side' zipper)
(|>> (with@ <side> side')
@@ -153,11 +153,11 @@
#.None
(#.Item last prevs)
- (#.Some (for {@.old [#family (#.Some (|> family
+ (#.Some (for [@.old [#family (#.Some (|> family
(with@ <side> #.End)
(revised@ <op_side> (|>> (#.Item (value@ #node zipper))
(list\composite prevs)))))
- #node last]}
+ #node last]]
(let [move (: (All (_ a) (-> (List (Tree a)) (Zipper a) (Family Zipper a) (Family Zipper a)))
(function (_ prevs zipper)
(|>> (with@ <side> #.End)
diff --git a/stdlib/source/library/lux/data/text.lux b/stdlib/source/library/lux/data/text.lux
index aadcb9dbe..b3961edc4 100644
--- a/stdlib/source/library/lux/data/text.lux
+++ b/stdlib/source/library/lux/data/text.lux
@@ -184,7 +184,7 @@
(def: .public (replaced pattern replacement template)
(-> Text Text Text Text)
- (for {@.old
+ (for [@.old
(:as Text
("jvm invokevirtual:java.lang.String:replace:java.lang.CharSequence,java.lang.CharSequence"
(:as (primitive "java.lang.String") template)
@@ -214,7 +214,7 @@
... TODO @.scheme
... TODO @.common_lisp
... TODO @.r
- }
+ ]
... Inefficient default
(loop [left ""
right template]
@@ -253,7 +253,7 @@
(def: &equivalence ..equivalence)
(def: (hash input)
- (for {@.old
+ (for [@.old
(|> input
(: (primitive "java.lang.String"))
"jvm invokevirtual:java.lang.String:hashCode:"
@@ -267,7 +267,7 @@
"jvm conversion int-to-long"
"jvm object cast"
(: (primitive "java.lang.Long"))
- (:as Nat))}
+ (:as Nat))]
... Platform-independent default.
(let [length ("lux text size" input)]
(loop [index 0
@@ -323,7 +323,7 @@
(def: .public (lower_cased value)
(-> Text Text)
- (for {@.old
+ (for [@.old
(:as Text
("jvm invokevirtual:java.lang.String:toLowerCase:"
(:as (primitive "java.lang.String") value)))
@@ -342,11 +342,11 @@
("lua apply" ("lua constant" "string.lower") value))
@.ruby
(:as Text
- ("ruby object do" "downcase" value))}))
+ ("ruby object do" "downcase" value))]))
(def: .public (upper_cased value)
(-> Text Text)
- (for {@.old
+ (for [@.old
(:as Text
("jvm invokevirtual:java.lang.String:toUpperCase:"
(:as (primitive "java.lang.String") value)))
@@ -365,4 +365,4 @@
("lua apply" ("lua constant" "string.upper") value))
@.ruby
(:as Text
- ("ruby object do" "upcase" value))}))
+ ("ruby object do" "upcase" value))]))
diff --git a/stdlib/source/library/lux/data/text/buffer.lux b/stdlib/source/library/lux/data/text/buffer.lux
index af3341930..b8955f732 100644
--- a/stdlib/source/library/lux/data/text/buffer.lux
+++ b/stdlib/source/library/lux/data/text/buffer.lux
@@ -34,7 +34,7 @@
["[1]::[0]"
(new [int])
(toString [] java/lang/String)]))]
- (`` (for {@.old (as_is <jvm>)
+ (`` (for [@.old (as_is <jvm>)
@.jvm (as_is <jvm>)
@.js (as_is (import: (JS_Array a)
["[1]::[0]"
@@ -44,24 +44,24 @@
...https://www.lua.org/manual/5.3/manual.html#pdf-table.concat
(import: (table/insert [(array.Array Text) Text] "?" Nothing))
... https://www.lua.org/manual/5.3/manual.html#pdf-table.insert
- )}
+ )]
(as_is))))
(`` (abstract: .public Buffer
- (for {@.old [Nat (-> java/lang/StringBuilder java/lang/StringBuilder)]
+ (for [@.old [Nat (-> java/lang/StringBuilder java/lang/StringBuilder)]
@.jvm [Nat (-> java/lang/StringBuilder java/lang/StringBuilder)]
@.js [Nat (-> (JS_Array Text) (JS_Array Text))]
- @.lua [Nat (-> (array.Array Text) (array.Array Text))]}
+ @.lua [Nat (-> (array.Array Text) (array.Array Text))]]
... default
(Row Text))
[(def: .public empty
Buffer
(:abstraction (with_expansions [<jvm> [0 function.identity]]
- (for {@.old <jvm>
+ (for [@.old <jvm>
@.jvm <jvm>
@.js [0 function.identity]
- @.lua [0 function.identity]}
+ @.lua [0 function.identity]]
... default
row.empty))))
@@ -76,7 +76,7 @@
builder)))]
(:abstraction [(n.+ (//.size chunk) capacity)
(|>> transform (then! chunk))]))]
- (for {@.old <jvm>
+ (for [@.old <jvm>
@.jvm <jvm>
@.js (let [[capacity transform] (:representation buffer)
then! (: (-> (JS_Array Text) (JS_Array Text))
@@ -93,17 +93,17 @@
(table/insert [array chunk])
array)))]
(:abstraction [(n.+ (//.size chunk) capacity)
- (|>> transform then!)]))}
+ (|>> transform then!)]))]
... default
(|> buffer :representation (row.suffix chunk) :abstraction))))
(def: .public size
(-> Buffer Nat)
(with_expansions [<jvm> (|>> :representation product.left)]
- (for {@.old <jvm>
+ (for [@.old <jvm>
@.jvm <jvm>
@.js <jvm>
- @.lua <jvm>}
+ @.lua <jvm>]
... default
(|>> :representation
(row\mix (function (_ chunk total)
@@ -116,7 +116,7 @@
(|> (java/lang/StringBuilder::new (.int capacity))
transform
java/lang/StringBuilder::toString))]
- (for {@.old <jvm>
+ (for [@.old <jvm>
@.jvm <jvm>
@.js (let [[capacity transform] (:representation buffer)]
(|> (array.empty 0)
@@ -124,7 +124,7 @@
transform
(JS_Array::join [""])))
@.lua (let [[capacity transform] (:representation buffer)]
- (table/concat [(transform (array.empty 0)) ""]))}
+ (table/concat [(transform (array.empty 0)) ""]))]
... default
(row\mix (function (_ chunk total)
(format total chunk))
diff --git a/stdlib/source/library/lux/data/text/encoding/utf8.lux b/stdlib/source/library/lux/data/text/encoding/utf8.lux
index 19867bae4..817288316 100644
--- a/stdlib/source/library/lux/data/text/encoding/utf8.lux
+++ b/stdlib/source/library/lux/data/text/encoding/utf8.lux
@@ -15,7 +15,7 @@
["[1]::[0]"
(new [[byte] java/lang/String])
(getBytes [java/lang/String] [byte])]))]
- (for {@.old (as_is <jvm>)
+ (for [@.old (as_is <jvm>)
@.jvm (as_is <jvm>)
@.js
@@ -59,12 +59,12 @@
@.scheme
... https://srfi.schemers.org/srfi-140/srfi-140.html
(as_is (ffi.import: (string->utf8 [Text] Binary))
- (ffi.import: (utf8->string [Binary] Text)))}
+ (ffi.import: (utf8->string [Binary] Text)))]
(as_is)))
(def: (encoded value)
(-> Text Binary)
- (for {@.old
+ (for [@.old
(java/lang/String::getBytes (//.name //.utf_8)
... TODO: Remove coercion below.
... The coercion below may seem
@@ -109,12 +109,12 @@
(:as Binary))
@.scheme
- (..string->utf8 value)}))
+ (..string->utf8 value)]))
(def: (decoded value)
(-> Binary (Try Text))
(with_expansions [<jvm> (#try.Success (java/lang/String::new value (//.name //.utf_8)))]
- (for {@.old <jvm>
+ (for [@.old <jvm>
@.jvm <jvm>
@.js
@@ -155,7 +155,7 @@
@.scheme
(|> value
..utf8->string
- #try.Success)})))
+ #try.Success)])))
(implementation: .public codec
(Codec Binary Text)
diff --git a/stdlib/source/library/lux/debug.lux b/stdlib/source/library/lux/debug.lux
index 8ce5e58e7..8f3245ea2 100644
--- a/stdlib/source/library/lux/debug.lux
+++ b/stdlib/source/library/lux/debug.lux
@@ -66,7 +66,7 @@
(intValue [] int)
(longValue [] long)
(doubleValue [] double)]))]
- (for {@.old (as_is <jvm>)
+ (for [@.old (as_is <jvm>)
@.jvm (as_is <jvm>)
@.js
@@ -114,24 +114,24 @@
(import: (car [.Any] .Any))
(import: (cdr [.Any] .Any))
(import: (format [Text .Any] Text)))
- }))
+ ]))
(def: Inspector
(.type (Format Any)))
-(for {@.lua (def: (tuple_array tuple)
+(for [@.lua (def: (tuple_array tuple)
(-> (array.Array Any) (array.Array Any))
(array.of_list
(loop [idx 0]
(let [member ("lua array read" idx tuple)]
(if ("lua object nil?" member)
#.End
- (#.Item member (recur (++ idx))))))))}
+ (#.Item member (recur (++ idx))))))))]
(as_is))
(def: (tuple_inspection inspection)
(-> Inspector Inspector)
- (with_expansions [<adaption> (for {@.lua (~~ (as_is ..tuple_array))}
+ (with_expansions [<adaption> (for [@.lua (~~ (as_is ..tuple_array))]
(~~ (as_is)))]
(`` (|>> (:as (array.Array Any))
<adaption>
@@ -175,7 +175,7 @@
(tuple_inspection inspection value)))
#.None)
(java/lang/Object::toString object))))]
- (for {@.old <jvm>
+ (for [@.old <jvm>
@.jvm <jvm>
@.js
@@ -374,7 +374,7 @@
... else
(..format ["~s" value])
))
- })))
+ ])))
(exception: .public (cannot_represent_value [type Type])
(exception.report
diff --git a/stdlib/source/library/lux/math.lux b/stdlib/source/library/lux/math.lux
index b81ca5c50..d6c85234d 100644
--- a/stdlib/source/library/lux/math.lux
+++ b/stdlib/source/library/lux/math.lux
@@ -18,7 +18,7 @@
[tau +6.28318530717958647692]
)
-(for {@.old
+(for [@.old
(as_is (template [<name> <method>]
[(def: .public (<name> it)
(-> Frac Frac)
@@ -282,7 +282,7 @@
(def: .public root/3
(-> Frac Frac)
(..pow ("lux f64 /" +3.0 +1.0))))
- })
+ ])
(def: .public (round it)
(-> Frac Frac)
diff --git a/stdlib/source/library/lux/program.lux b/stdlib/source/library/lux/program.lux
index 00e75d32c..7b81afa69 100644
--- a/stdlib/source/library/lux/program.lux
+++ b/stdlib/source/library/lux/program.lux
@@ -35,10 +35,10 @@
(let [initialization+event_loop
(` ((~! do) (~! io.monad)
[(~ g!output) (~ body)
- (~+ (for {@.old (list)
+ (~+ (for [@.old (list)
@.jvm (list)
@.js (list)
- @.python (list)}
+ @.python (list)]
(list g!_ (` (~! thread.run!)))))]
((~' in) (~ g!output))))]
(in (list (` ("lux def program"
diff --git a/stdlib/source/library/lux/target/jvm/constant.lux b/stdlib/source/library/lux/target/jvm/constant.lux
index ef1076787..d1e9b2122 100644
--- a/stdlib/source/library/lux/target/jvm/constant.lux
+++ b/stdlib/source/library/lux/target/jvm/constant.lux
@@ -71,13 +71,13 @@
(Equivalence java/lang/Float)
(def: (= parameter subject)
- (for {@.old
+ (for [@.old
("jvm feq" parameter subject)
@.jvm
("jvm float ="
("jvm object cast" parameter)
- ("jvm object cast" subject))})))
+ ("jvm object cast" subject))])))
(import: java/lang/Double
["[1]::[0]"
diff --git a/stdlib/source/library/lux/target/jvm/loader.lux b/stdlib/source/library/lux/target/jvm/loader.lux
index fe2bba2e6..1d5eda342 100644
--- a/stdlib/source/library/lux/target/jvm/loader.lux
+++ b/stdlib/source/library/lux/target/jvm/loader.lux
@@ -102,11 +102,11 @@
(def: .public (memory library)
(-> Library java/lang/ClassLoader)
- (with_expansions [<cast> (for {@.old
+ (with_expansions [<cast> (for [@.old
(<|)
@.jvm
- "jvm object cast"})]
+ "jvm object cast"])]
(<| <cast>
(object [] java/lang/ClassLoader []
[]
diff --git a/stdlib/source/library/lux/target/python.lux b/stdlib/source/library/lux/target/python.lux
index 4988e4d78..af0514a76 100644
--- a/stdlib/source/library/lux/target/python.lux
+++ b/stdlib/source/library/lux/target/python.lux
@@ -31,19 +31,19 @@
(-> Text Text)
(text.enclosed ["(" ")"]))
-(for {@.old (as_is (ffi.import: java/lang/CharSequence)
+(for [@.old (as_is (ffi.import: java/lang/CharSequence)
(ffi.import: java/lang/String
["[1]::[0]"
- (replace [java/lang/CharSequence java/lang/CharSequence] java/lang/String)]))}
+ (replace [java/lang/CharSequence java/lang/CharSequence] java/lang/String)]))]
(as_is))
(def: nested
(-> Text Text)
(.let [nested_new_line (format text.new_line text.tab)]
- (for {@.old (|>> (format text.new_line)
+ (for [@.old (|>> (format text.new_line)
(:as java/lang/String)
(java/lang/String::replace (:as java/lang/CharSequence text.new_line)
- (:as java/lang/CharSequence nested_new_line)))}
+ (:as java/lang/CharSequence nested_new_line)))]
(|>> (format text.new_line)
(text.replaced text.new_line nested_new_line)))))
diff --git a/stdlib/source/library/lux/time/instant.lux b/stdlib/source/library/lux/time/instant.lux
index 696b204b0..57063a5a0 100644
--- a/stdlib/source/library/lux/time/instant.lux
+++ b/stdlib/source/library/lux/time/instant.lux
@@ -152,7 +152,7 @@
(def: .public now
(IO Instant)
- (io (..of_millis (for {@.old ("jvm invokestatic:java.lang.System:currentTimeMillis:")
+ (io (..of_millis (for [@.old ("jvm invokestatic:java.lang.System:currentTimeMillis:")
@.jvm (|> ("jvm member invoke static" [] "java.lang.System" "currentTimeMillis" [])
("jvm object cast")
(: (primitive "java.lang.Long"))
@@ -189,7 +189,7 @@
"common_lisp apply"
(:as Int)
(i.* +1,000))
- }))))
+ ]))))
(template [<field> <type> <post_processing>]
[(def: .public (<field> instant)
diff --git a/stdlib/source/library/lux/tool/compiler/default/platform.lux b/stdlib/source/library/lux/tool/compiler/default/platform.lux
index be5d7df27..d24ad8f33 100644
--- a/stdlib/source/library/lux/tool/compiler/default/platform.lux
+++ b/stdlib/source/library/lux/tool/compiler/default/platform.lux
@@ -101,11 +101,11 @@
(ioW.write system static module_id artifact_id content)))]
(do [! ..monad]
[_ (ioW.prepare system static module_id)
- _ (for {@.python (|> output
+ _ (for [@.python (|> output
row.list
(list.sub 128)
(monad.each ! (monad.each ! write_artifact!))
- (: (Action (List (List Any)))))}
+ (: (Action (List (List Any)))))]
(|> output
row.list
(monad.each ..monad write_artifact!)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/js.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/js.lux
index f5f47f98d..66b58bf74 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/js.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/js.lux
@@ -199,7 +199,7 @@
[.let [inputT (type.tuple (list.repeated arity Any))]
abstractionA (analysis/type.with_type (-> inputT Any)
(phase archive abstractionC))
- _ (analysis/type.infer (for {@.js ffi.Function}
+ _ (analysis/type.infer (for [@.js ffi.Function]
Any))]
(in (#analysis.Extension extension (list (analysis.nat arity)
abstractionA)))))]))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lua.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lua.lux
index dd7d43516..f7ed4ed54 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lua.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lua.lux
@@ -29,15 +29,15 @@
["[0]" phase]]]]]])
(def: Nil
- (for {@.lua ffi.Nil}
+ (for [@.lua ffi.Nil]
Any))
(def: Object
- (for {@.lua (type (ffi.Object Any))}
+ (for [@.lua (type (ffi.Object Any))]
Any))
(def: Function
- (for {@.lua ffi.Function}
+ (for [@.lua ffi.Function]
Any))
(def: array::new
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/php.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/php.lux
index 227bc4539..a52f8bb53 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/php.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/php.lux
@@ -108,15 +108,15 @@
)))
(def: Null
- (for {@.php ffi.Null}
+ (for [@.php ffi.Null]
Any))
(def: Object
- (for {@.php (type (ffi.Object Any))}
+ (for [@.php (type (ffi.Object Any))]
Any))
(def: Function
- (for {@.php ffi.Function}
+ (for [@.php ffi.Function]
Any))
(def: object::new
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/python.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/python.lux
index 2f07f677b..700f80163 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/python.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/python.lux
@@ -108,20 +108,23 @@
)))
(def: None
- (for {@.python
- ffi.None}
+ (for [@.python
+ ffi.None]
Any))
(def: Object
- (for {@.python (type (ffi.Object Any))}
+ (for [@.python
+ (type (ffi.Object Any))]
Any))
(def: Function
- (for {@.python ffi.Function}
+ (for [@.python
+ ffi.Function]
Any))
(def: Dict
- (for {@.python ffi.Dict}
+ (for [@.python
+ ffi.Dict]
Any))
(def: object::get
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/ruby.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/ruby.lux
index d267ca612..6bf24f1fa 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/ruby.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/ruby.lux
@@ -108,15 +108,15 @@
)))
(def: Nil
- (for {@.ruby ffi.Nil}
+ (for [@.ruby ffi.Nil]
Any))
(def: Object
- (for {@.ruby (type (ffi.Object Any))}
+ (for [@.ruby (type (ffi.Object Any))]
Any))
(def: Function
- (for {@.ruby ffi.Function}
+ (for [@.ruby ffi.Function]
Any))
(def: object::get
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/scheme.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/scheme.lux
index 688803a33..2075522d7 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/scheme.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/scheme.lux
@@ -108,12 +108,12 @@
)))
(def: Nil
- (for {@.scheme
- ffi.Nil}
+ (for [@.scheme
+ ffi.Nil]
Any))
(def: Function
- (for {@.scheme ffi.Function}
+ (for [@.scheme ffi.Function]
Any))
(def: bundle::object
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/common.lux
index e71de0758..1be1bcfa5 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/common.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/common.lux
@@ -211,7 +211,7 @@
(/.install "index" (trinary ..text//index))
(/.install "size" (unary //runtime.text//size))
... TODO: Use version below once the Lua compiler becomes self-hosted.
- ... (/.install "size" (unary (for {@.lua (!unary "utf8.len")}
+ ... (/.install "size" (unary (for [@.lua (!unary "utf8.len")]
... (!unary "string.len"))))
(/.install "char" (binary ..text//char))
(/.install "clip" (trinary ..text//clip))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/runtime.lux
index d2b823b85..9ed2c2624 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/runtime.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/runtime.lux
@@ -342,7 +342,7 @@
(..char_index subject)
..lux_index)))))]
(with_vars [byte_index]
- (for {@.lua <normal>}
+ (for [@.lua <normal>]
(_.if ..on_rembulan?
<rembulan>
<normal>)))))
@@ -356,7 +356,7 @@
... (_.+ (_.int +1))
(..byte_index text)
(_.- (_.int +1)))))]
- (for {@.lua <normal>}
+ (for [@.lua <normal>]
(_.if ..on_rembulan?
<rembulan>
<normal>))))
@@ -364,7 +364,7 @@
(runtime: (text//size subject)
(with_expansions [<rembulan> (_.return (_.apply/1 (_.var "string.len") subject))
<normal> (_.return (_.apply/1 (_.var "utf8.len") subject))]
- (for {@.lua <normal>}
+ (for [@.lua <normal>]
(_.if ..on_rembulan?
<rembulan>
<normal>))))
@@ -383,7 +383,7 @@
(_.if (_.= _.nil offset)
(_.statement (_.error/1 (_.string "[Lux Error] Cannot get char from text.")))
(_.return (_.apply/2 (_.var "utf8.codepoint") text offset)))))]
- (for {@.lua <normal>}
+ (for [@.lua <normal>]
(_.if ..on_rembulan?
<rembulan>
<normal>))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/runtime.lux
index bfdf279fa..16283e2e9 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/runtime.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/runtime.lux
@@ -291,7 +291,7 @@
[(_.> ..i64::+limit) ..i64::+iteration ..i64::+cap ..i64::-limit]
[(_.< ..i64::-limit) ..i64::-iteration ..i64::-cap ..i64::+limit]
))
- (_.return (for {@.python input}
+ (_.return (for [@.python input]
... This +- is only necessary to guarantee that values within the limits are always longs in Python 2
(|> input (_.+ ..i64::+limit) (_.- ..i64::+limit))))))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/reference.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/reference.lux
index b256823f5..4913559a1 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/reference.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/reference.lux
@@ -18,23 +18,23 @@
... This universe constant is for languages where one can't just turn all compiled definitions
... into the local variables of some scoping function.
(def: .public universe
- (for {... In the case of Lua, there is a limit of 200 locals in a function's scope.
+ (for [ ... In the case of Lua, there is a limit of 200 locals in a function's scope.
@.lua (not ("lua script universe"))
... Cannot make all definitions be local variables because of limitations with JRuby.
@.ruby (not ("ruby script universe"))
... Cannot make all definitions be local variables because of limitations with PHP itself.
@.php (not ("php script universe"))
... Cannot make all definitions be local variables because of limitations with Kawa.
- @.scheme (not ("scheme script universe"))}
+ @.scheme (not ("scheme script universe"))]
#0))
(def: universe_label
Text
(with_expansions [<label> (format "u" (%.nat (if ..universe 1 0)))]
- (for {@.lua <label>
+ (for [@.lua <label>
@.ruby <label>
@.php <label>
- @.scheme <label>}
+ @.scheme <label>]
"")))
(def: .public (artifact [module artifact])
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux b/stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux
index 3df8bb802..bd1aca3b3 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux
@@ -51,7 +51,7 @@
["[0]" frac]]]]])
(template: (inline: <declaration> <type> <body>)
- [(for {@.python (def: <declaration> <type> <body>)}
+ [(for [@.python (def: <declaration> <type> <body>)]
(template: <declaration> [<body>]))])
... TODO: Implement "lux syntax char case!" as a custom extension.
diff --git a/stdlib/source/library/lux/type.lux b/stdlib/source/library/lux/type.lux
index effdf2251..7c347bd0e 100644
--- a/stdlib/source/library/lux/type.lux
+++ b/stdlib/source/library/lux/type.lux
@@ -179,7 +179,8 @@
(Equivalence Type)
(def: (= x y)
- (or (for {@.php false} ... TODO: Remove this once JPHP is gone.
+ (or (for [... TODO: Remove this once JPHP is gone.
+ @.php false]
(same? x y))
(case [x y]
[(#.Primitive xname xparams) (#.Primitive yname yparams)]
diff --git a/stdlib/source/library/lux/type/check.lux b/stdlib/source/library/lux/type/check.lux
index 51bb8d13e..bf8210953 100644
--- a/stdlib/source/library/lux/type/check.lux
+++ b/stdlib/source/library/lux/type/check.lux
@@ -557,7 +557,8 @@
... Type-check to ensure that the 'expected' type subsumes the 'actual' type.
(def: (check' assumptions expected actual)
(Checker Type)
- (if (for {@.php false} ... TODO: Remove this once JPHP is gone.
+ (if (for [... TODO: Remove this once JPHP is gone.
+ @.php false]
(same? expected actual))
(check\in assumptions)
(with ..type_check_failed [expected actual]
diff --git a/stdlib/source/library/lux/world/console.lux b/stdlib/source/library/lux/world/console.lux
index a31de2fdc..e3d156adf 100644
--- a/stdlib/source/library/lux/world/console.lux
+++ b/stdlib/source/library/lux/world/console.lux
@@ -94,8 +94,8 @@
(def: close
(|>> (exception.except ..cannot_close) in)))))))))]
- (for {@.old (as_is <jvm>)
- @.jvm (as_is <jvm>)}
+ (for [@.old (as_is <jvm>)
+ @.jvm (as_is <jvm>)]
(as_is)))
(def: .public (write_line message console)
diff --git a/stdlib/source/library/lux/world/file.lux b/stdlib/source/library/lux/world/file.lux
index 9cbb0f8e4..66c125a34 100644
--- a/stdlib/source/library/lux/world/file.lux
+++ b/stdlib/source/library/lux/world/file.lux
@@ -297,7 +297,7 @@
java/io/File::new
(java/io/File::renameTo (java/io/File::new destination))))
)))]
- (for {@.old (as_is <for_jvm>)
+ (for [@.old (as_is <for_jvm>)
@.jvm (as_is <for_jvm>)
@.js
@@ -983,7 +983,7 @@
... ..default_separator)
... ))
... )
- }
+ ]
(as_is)))
(def: .public (exists? monad fs path)
diff --git a/stdlib/source/library/lux/world/file/watch.lux b/stdlib/source/library/lux/world/file/watch.lux
index d26778c03..3af235af1 100644
--- a/stdlib/source/library/lux/world/file/watch.lux
+++ b/stdlib/source/library/lux/world/file/watch.lux
@@ -456,6 +456,6 @@
(async.future (..default_poll watcher)))
)))))
)]
- (for {@.old (as_is <jvm>)
- @.jvm (as_is <jvm>)}
+ (for [@.old (as_is <jvm>)
+ @.jvm (as_is <jvm>)]
(as_is)))
diff --git a/stdlib/source/library/lux/world/net/http/client.lux b/stdlib/source/library/lux/world/net/http/client.lux
index a2ec857a0..c5af6d11f 100644
--- a/stdlib/source/library/lux/world/net/http/client.lux
+++ b/stdlib/source/library/lux/world/net/http/client.lux
@@ -213,8 +213,8 @@
(in [(.nat status)
[#//.headers headers
#//.body (..default_body input)]]))))))]
- (for {@.old (as_is <jvm>)
- @.jvm (as_is <jvm>)}
+ (for [@.old (as_is <jvm>)
+ @.jvm (as_is <jvm>)]
(as_is)))
(implementation: .public (async client)
diff --git a/stdlib/source/library/lux/world/program.lux b/stdlib/source/library/lux/world/program.lux
index 3203a12b1..feb95fff9 100644
--- a/stdlib/source/library/lux/world/program.lux
+++ b/stdlib/source/library/lux/world/program.lux
@@ -141,7 +141,7 @@
(jvm\\consume iterator))
#.End))
)]
- (for {@.old (as_is <jvm>)
+ (for [@.old (as_is <jvm>)
@.jvm (as_is <jvm>)
@.js (as_is (def: default_exit!
(-> Exit (IO Nothing))
@@ -299,7 +299,7 @@
... (ffi.import: (cdr [Pair] Text))
... (ffi.import: (car "as" head [PList] Pair))
... (ffi.import: (cdr "as" tail [PList] PList)))
- }
+ ]
(as_is)))
(implementation: .public default
@@ -310,7 +310,7 @@
java/util/Map::keySet
java/util/Set::iterator
..jvm\\consume))]
- (for {@.old <jvm>
+ (for [@.old <jvm>
@.jvm <jvm>
@.js (io.io (if ffi.on_node_js?
(case (ffi.constant Object [process env])
@@ -345,7 +345,7 @@
... (let [entry (..head input)]
... (recur (..tail input)
... (dictionary.has (..car entry) (..cdr entry) output))))))
- })))
+ ])))
(def: (variable name)
(template.let [(!fetch <method>)
@@ -358,7 +358,7 @@
#.None
(exception.except ..unknown_environment_variable [name]))))]]
(with_expansions [<jvm> (!fetch java/lang/System::resolveEnv)]
- (for {@.old <jvm>
+ (for [@.old <jvm>
@.jvm <jvm>
@.js (io.io (if ffi.on_node_js?
(case (do maybe.monad
@@ -374,13 +374,13 @@
@.python (!fetch os/environ::get)
@.lua (!fetch os/getenv)
@.ruby (!fetch RubyEnv::fetch)
- }))))
+ ]))))
(def: home
(io.run!
(with_expansions [<default> (io.io "~")
<jvm> (io.io (maybe.else "" (java/lang/System::getProperty "user.home")))]
- (for {@.old <jvm>
+ (for [@.old <jvm>
@.jvm <jvm>
@.js (if ffi.on_node_js?
(|> (..require [] "os")
@@ -395,7 +395,7 @@
... (in (if (bit\= false (:as Bit output))
... "~"
... output)))
- }
+ ]
... TODO: Replace dummy implementation.
<default>))))
@@ -403,7 +403,7 @@
(io.run!
(with_expansions [<default> "."
<jvm> (io.io (maybe.else "" (java/lang/System::getProperty "user.dir")))]
- (for {@.old <jvm>
+ (for [@.old <jvm>
@.jvm <jvm>
@.js (if ffi.on_node_js?
(case (ffi.constant ..NodeJs_Process [process])
@@ -426,7 +426,7 @@
... (in (if (bit\= false (:as Bit output))
... "."
... output)))
- }
+ ]
... TODO: Replace dummy implementation.
(io.io <default>)))))
@@ -434,7 +434,7 @@
(with_expansions [<jvm> (do io.monad
[_ (java/lang/System::exit code)]
(in (undefined)))]
- (for {@.old <jvm>
+ (for [@.old <jvm>
@.jvm <jvm>
@.js (cond ffi.on_node_js?
(..exit_node_js! code)
@@ -449,4 +449,4 @@
@.ruby (RubyKernel::exit [code])
... @.php (..exit [code])
... @.scheme (..exit [code])
- }))))
+ ]))))
diff --git a/stdlib/source/library/lux/world/shell.lux b/stdlib/source/library/lux/world/shell.lux
index 07a9b3f3f..5c0fdfbc7 100644
--- a/stdlib/source/library/lux/world/shell.lux
+++ b/stdlib/source/library/lux/world/shell.lux
@@ -306,8 +306,8 @@
process (java/lang/ProcessBuilder::start builder)]
(..default_process process))))
)]
- (for {@.old (as_is <jvm>)
- @.jvm (as_is <jvm>)}
+ (for [@.old (as_is <jvm>)
+ @.jvm (as_is <jvm>)]
(as_is)))
(type: .public (Mock s)