Skip to content

Commit 7670491

Browse files
committed
Moved some modules to new locations.
1 parent 433acf4 commit 7670491

File tree

87 files changed

+676
-677
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+676
-677
lines changed

lux-js/source/program.lux

+1-1
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@
594594
... Note: I have to call "eval" this way
595595
... in order to avoid a quirk of calling eval in Node
596596
... when the code is running under "use strict";.
597-
(try (let [return (.js_apply# (function.identity (.js_constant# "eval")) [code])]
597+
(try (let [return (.js_of# (function.identity (.js_constant# "eval")) [code])]
598598
(if (.js_object_null?# return)
599599
{.#None}
600600
{.#Some return}))))

lux-jvm/source/program.lux

+8-8
Original file line numberDiff line numberDiff line change
@@ -75,30 +75,30 @@
7575
(java/lang/Class java/lang/Object)
7676
(ffi.class_for java/lang/Object))
7777

78-
(the _apply2_args
78+
(the _of2_args
7979
(Array (java/lang/Class java/lang/Object))
8080
(ffi.array (java/lang/Class java/lang/Object)
8181
[_object_class _object_class]))
8282

83-
(the _apply4_args
83+
(the _of4_args
8484
(Array (java/lang/Class java/lang/Object))
8585
(ffi.array (java/lang/Class java/lang/Object)
8686
[_object_class _object_class _object_class _object_class]))
8787

8888
(the .public (expander macro inputs lux)
8989
Expander
9090
(do try.monad
91-
[apply_method (|> macro
92-
(as (-> Macro java/lang/Object))
93-
(java/lang/Object::getClass [])
94-
(java/lang/Class::getMethod [(ffi.as_string "apply") _apply2_args]))]
91+
[of_method (|> macro
92+
(as (-> Macro java/lang/Object))
93+
(java/lang/Object::getClass [])
94+
(java/lang/Class::getMethod [(ffi.as_string "apply") _of2_args]))]
9595
(as (-> (Try java/lang/Object) (Try (Try [analysis.State (List @type.Code)])))
9696
(java/lang/reflect/Method::invoke
9797
[(as (-> Macro java/lang/Object) macro)
9898
(ffi.array java/lang/Object
9999
[(as (-> (List Code) java/lang/Object) inputs)
100100
(as (-> Lux java/lang/Object) lux)])]
101-
apply_method))))
101+
of_method))))
102102

103103
(the phase_wrapper
104104
phase.Wrapper
@@ -135,7 +135,7 @@
135135
[method (|> handler
136136
(as (-> Any java/lang/Object))
137137
(java/lang/Object::getClass [])
138-
(java/lang/Class::getMethod [(ffi.as_string "apply") _apply4_args]))]
138+
(java/lang/Class::getMethod [(ffi.as_string "apply") _of4_args]))]
139139
(java/lang/reflect/Method::invoke
140140
[(as (-> Any java/lang/Object) handler)
141141
(ffi.array java/lang/Object

lux-lua/source/program.lux

+31-31
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@
290290
(list $input (` (..read (, $input))))))
291291
list#conjoint))
292292

293-
(the (apply/* to_host self parameters abstraction)
293+
(the (of/* to_host self parameters abstraction)
294294
(-> (-> Any java/lang/Object) net/sandius/rembulan/runtime/LuaFunction (List java/lang/Object) Any Any)
295295
(<| try.trusted
296296
(do [! try.monad]
@@ -344,10 +344,10 @@
344344
void
345345
"throws" [net/sandius/rembulan/runtime/ResolvedControlThrowable]
346346
(<| (..return %)
347-
(apply/* to_host
348-
(ffi.is net/sandius/rembulan/runtime/LuaFunction self)
349-
(list (,, (static.literals function.identity (..input/* <arity>))))
350-
lux_function)))]
347+
(of/* to_host
348+
(ffi.is net/sandius/rembulan/runtime/LuaFunction self)
349+
(list (,, (static.literals function.identity (..input/* <arity>))))
350+
lux_function)))]
351351

352352
[1]
353353
[2]
@@ -362,10 +362,10 @@
362362
void
363363
"throws" [net/sandius/rembulan/runtime/ResolvedControlThrowable]
364364
(<| (..return %)
365-
(apply/* to_host
366-
(ffi.is net/sandius/rembulan/runtime/LuaFunction self)
367-
(list.of_array {.#None} input/*)
368-
lux_function)))
365+
(of/* to_host
366+
(ffi.is net/sandius/rembulan/runtime/LuaFunction self)
367+
(list.of_array {.#None} input/*)
368+
lux_function)))
369369
)))))
370370

371371
(ffi.import library/lux/Function
@@ -519,8 +519,8 @@
519519
$b3 (_.var "b3")
520520
$b4 (_.var "b4")
521521
table/insert (function (_ in/0 in/1)
522-
(_.apply (list in/0 in/1)
523-
(_.var "table.insert")))]
522+
(_.of (list in/0 in/1)
523+
(_.var "table.insert")))]
524524
(_.function (_.var "utf8.char") (list $var_args)
525525
(all _.then
526526
(_.local/1 $buffer (_.array (list)))
@@ -535,30 +535,30 @@
535535
(<| (_.if (_.< (!integer "80") $v)
536536
... Single-byte sequence
537537
(_.; (|> (_.var "string.char")
538-
(_.apply (list $v))
538+
(_.of (list $v))
539539
(table/insert $buffer))))
540540
(_.if (_.< (!integer "800") $v)
541541
... Two-byte sequence
542542
(_.; (|> (_.var "string.char")
543-
(_.apply (list (!&|< "C0" "1F" +6 $v)
544-
(!&| "80" "3F" $v)))
543+
(_.of (list (!&|< "C0" "1F" +6 $v)
544+
(!&| "80" "3F" $v)))
545545
(table/insert $buffer))))
546546
(_.if (_.< (!integer "10000") $v)
547547
... Three-byte sequence
548548
(_.; (|> (_.var "string.char")
549-
(_.apply (list (!&|< "E0" "0F" +12 $v)
550-
(!&|< "80" "3F" +6 $v)
551-
(!&| "80" "3F" $v)))
549+
(_.of (list (!&|< "E0" "0F" +12 $v)
550+
(!&|< "80" "3F" +6 $v)
551+
(!&| "80" "3F" $v)))
552552
(table/insert $buffer))))
553553
... Four-byte sequence
554554
(_.; (|> (_.var "string.char")
555-
(_.apply (list (!&|< "F0" "07" +18 $v)
556-
(!&|< "80" "3F" +12 $v)
557-
(!&|< "80" "3F" +6 $v)
558-
(!&| "80" "3F" $v)))
555+
(_.of (list (!&|< "F0" "07" +18 $v)
556+
(!&|< "80" "3F" +12 $v)
557+
(!&|< "80" "3F" +6 $v)
558+
(!&| "80" "3F" $v)))
559559
(table/insert $buffer))))
560560
))
561-
(_.return (_.apply (list $buffer (_.string "")) (_.var "table.concat")))
561+
(_.return (_.of (list $buffer (_.string "")) (_.var "table.concat")))
562562
))))
563563

564564
... (the rembulan//str_rel_to_abs
@@ -578,7 +578,7 @@
578578
... (_.> (_.length $string) $v))
579579
... (_.; (_.error/2 (_.string "bad index to string (out of range)") (_.int +3))))
580580
... (_.set (list (_.nth $k $args)) $v)))
581-
... (_.return (_.apply (list $args) (_.var "table.unpack")))
581+
... (_.return (_.of (list $args) (_.var "table.unpack")))
582582
... ))))
583583

584584
... (the rembulan//decode
@@ -590,7 +590,7 @@
590590
... $end (_.var "_end")]
591591
... (<| (_.local_function $decode (list $string $start))
592592
... (all _.then
593-
... (_.set (list $start) (_.apply (list $string (_.or (_.int +1) $start)) $str_rel_to_abs))
593+
... (_.set (list $start) (_.of (list $string (_.or (_.int +1) $start)) $str_rel_to_abs))
594594
... (_.local/1 $b1 (_.do "byte" (list $start $start) $string))
595595
... (<| (_.if (_.< (!integer "80") $b1)
596596
... ... Single-byte sequence
@@ -630,7 +630,7 @@
630630
... (_.if (_.> (_.length $string) $i)
631631
... (_.return _.nil)
632632
... (all _.then
633-
... (_.let (list $start $end) (_.apply (list $string $i) $decode))
633+
... (_.let (list $start $end) (_.of (list $string $i) $decode))
634634
... (_.if (_.not $start)
635635
... (_.; (_.error/2 (_.string "invalid UTF-8 code") (_.int +2)))
636636
... (all _.then
@@ -649,11 +649,11 @@
649649
... $size (_.var "size")]
650650
... (_.function (_.var "utf8.len") (list $string $start $end)
651651
... (all _.then
652-
... (_.set (list $start $end) (_.apply (list $string (_.or (_.int +1) $start) (_.or (_.int -1) $end)) $str_rel_to_abs))
652+
... (_.set (list $start $end) (_.of (list $string (_.or (_.int +1) $start) (_.or (_.int -1) $end)) $str_rel_to_abs))
653653
... (_.local/1 $size (_.int +0))
654654
... (_.repeat (_.>= $end $seq_end)
655655
... (all _.then
656-
... (_.let (list $seq_start $seq_end) (_.apply (list $string $start) $decode))
656+
... (_.let (list $seq_start $seq_end) (_.of (list $string $start) $decode))
657657
... (_.if (_.not $seq_start)
658658
... ... Hit an invalid sequence!
659659
... (_.return (_.multi (list (_.boolean false) $start)))
@@ -745,7 +745,7 @@
745745
(function (_ code)
746746
(do try.monad
747747
[lua_function (..load (_.code code))]
748-
(let [output ("lua apply" lua_function)]
748+
(let [output ("lua of" lua_function)]
749749
{try.#Success (if ("lua object nil?" output)
750750
[]
751751
output)}))))]
@@ -858,9 +858,9 @@
858858
(the (lux_program context program)
859859
(Program _.Expression _.Statement)
860860
(let [$program (_.var (reference.artifact context))]
861-
(_.; (_.apply (list (runtime.lux//program_args (_.var "arg"))
862-
runtime.unit)
863-
program))))
861+
(_.; (_.of (list (runtime.lux//program_args (_.var "arg"))
862+
runtime.unit)
863+
program))))
864864

865865
(the (declare_success! _)
866866
(-> Any (Future Any))

lux-php/source/program.lux

+3-3
Original file line numberDiff line numberDiff line change
@@ -525,9 +525,9 @@
525525

526526
(the (program context program)
527527
(Program _.Expression _.Statement)
528-
(_.; (_.apply/2 program
529-
[(runtime.lux//program_args _.command_line_arguments)
530-
_.null])))
528+
(_.; (_.of/2 program
529+
[(runtime.lux//program_args _.command_line_arguments)
530+
_.null])))
531531

532532
(for .jvm
533533
(the extender

lux-python/source/program.lux

+8-8
Original file line numberDiff line numberDiff line change
@@ -551,13 +551,13 @@
551551
(all _.then
552552
(_.import "sys")
553553
(_.when (_.= (_.string "__main__") (_.var "__name__"))
554-
(_.; (_.apply (list (|> (_.var "sys") (_.its "argv")
555-
... The first entry in the list will be the program.py file itself
556-
... so, it must be removed so only the program's arguments are left.
557-
(_.slice_from (_.int +1))
558-
runtime.lux::program_args)
559-
_.none)
560-
program)))))
554+
(_.; (_.of (list (|> (_.var "sys") (_.its "argv")
555+
... The first entry in the list will be the program.py file itself
556+
... so, it must be removed so only the program's arguments are left.
557+
(_.slice_from (_.int +1))
558+
runtime.lux::program_args)
559+
_.none)
560+
program)))))
561561

562562
(the (declare_success! _)
563563
(-> Any (Future Any))
@@ -576,7 +576,7 @@
576576
(_.; (_.do "setrecursionlimit" (list new_limit) $sys))
577577
... (_.; (_.do "stack_size" (list current_limit) $threading))
578578
(_.def @program (list) body)
579-
(_.; (_.apply (list) @program))
579+
(_.; (_.of (list) @program))
580580
))))
581581

582582
(the (lux_compiler it)

lux-r/source/program.lux

+2-2
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@
570570

571571
(the (program context program)
572572
(Program _.Expression _.Expression)
573-
(_.apply/2 program [(runtime.lux::program_args (_.commandArgs/0 [])) _.null]))
573+
(_.of/2 program [(runtime.lux::program_args (_.commandArgs/0 [])) _.null]))
574574

575575
(for .jvm
576576
(the extender
@@ -603,7 +603,7 @@
603603
(let [$program (_.var "lux_program")]
604604
(all _.then
605605
(_.set! $program (_.function (stack) body))
606-
(_.apply/0 $program [])
606+
(_.of/0 $program [])
607607
)))
608608

609609
(`` (the _

lux-ruby/source/program.lux

+5-5
Original file line numberDiff line numberDiff line change
@@ -1015,11 +1015,11 @@
10151015
(list (_.string (_.code _.command_line_arguments)))
10161016
{.#None}
10171017
(is _.CVar (_.manual "Object")))]
1018-
(_.; (_.apply_lambda (list (runtime.lux//program_args (_.? normal_runtime?
1019-
_.command_line_arguments
1020-
(_.array (list))))
1021-
_.nil)
1022-
program))))
1018+
(_.; (_.of_lambda (list (runtime.lux//program_args (_.? normal_runtime?
1019+
_.command_line_arguments
1020+
(_.array (list))))
1021+
_.nil)
1022+
program))))
10231023

10241024
(the (declare_success! _)
10251025
(-> Any (Future Any))

stdlib/source/documentation/lux/control/concatenative.lux

+3-3
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@
9494
else (=> ,,,0 ,,,1)]
9595
,,,0 [Bit then else] ,,,1)))))
9696

97-
($.definition /.apply
97+
($.definition /.of
9898
"A generator for functions that turn arity N functions into arity N concatenative functions."
9999
($.example (' (is (=> [Natural] [Natural])
100-
((apply 1) ++)))))
100+
((of 1) ++)))))
101101

102102
(,, (template.with [<arity>]
103-
[(expansion.let [<name> (template.name [/._] ["apply_" <arity>])
103+
[(expansion.let [<name> (template.name [/._] ["of_" <arity>])
104104
<doc> (template.text ["Lift a function of arity " <arity>
105105
" into a concatenative function of arity " <arity> "."])]
106106
($.definition <name>

stdlib/source/documentation/lux/meta/compiler/target/js.lux

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
($.definition /.var)
8282
($.definition /.at)
8383
($.definition /.its)
84-
($.definition /.apply)
84+
($.definition /.of)
8585
($.definition /.do)
8686
($.definition /.object)
8787
($.definition /.,)

stdlib/source/documentation/lux/meta/compiler/target/lua.lux

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
($.definition /.item)
7979
($.definition /.its)
8080
($.definition /.length)
81-
($.definition /.apply)
81+
($.definition /.of)
8282
($.definition /.do)
8383
($.definition /.concat)
8484
($.definition /.or)

stdlib/source/documentation/lux/meta/compiler/target/python.lux

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
($.definition /.slice)
5252
($.definition /.slice_from)
5353
($.definition /.dict)
54-
($.definition /.apply)
54+
($.definition /.of)
5555
($.definition /.splat_poly)
5656
($.definition /.splat_keyword)
5757
($.definition /.its)

stdlib/source/documentation/lux/meta/compiler/target/ruby.lux

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@
6565
($.definition /.array_range)
6666
($.definition /.array)
6767
($.definition /.hash)
68-
($.definition /.apply)
69-
($.definition /.apply_lambda)
68+
($.definition /.of)
69+
($.definition /.of_lambda)
7070
($.definition /.its)
7171
($.definition /.item)
7272
($.definition /.?)

stdlib/source/library/lux/compiler/language/lux/phase/extension/analysis/js.lux

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
(pure [@ {analysis.#Extension (/.translation extension)
102102
(list (analysis.text @ name))}])))]))
103103

104-
(the js::apply
104+
(the js::of
105105
(-> Text Handler)
106106
(custom
107107
[(all <>.and ?list.any (<code>.tuple (<>.some ?list.any)))
@@ -151,7 +151,7 @@
151151
with_object_extensions
152152

153153
(/.with "js_constant#" js::constant)
154-
(/.with "js_apply#" js::apply)
154+
(/.with "js_of#" js::of)
155155
(/.with "js_type_of#" js::type_of)
156156
(/.with "js_function#" js::function)
157157
))

0 commit comments

Comments
 (0)