Skip to content

Commit

Permalink
Re-named List to Stack.
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoejp committed Feb 27, 2024
1 parent 049075a commit d278baf
Show file tree
Hide file tree
Showing 673 changed files with 17,062 additions and 17,284 deletions.
40 changes: 20 additions & 20 deletions lux-cl/source/program.lux
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@
[(exception.the (<name> object)
(Exception java/lang/Object)
(exception.report
(list ["Class" (java/lang/Object::toString (java/lang/Object::getClass object))]
["Object" (java/lang/Object::toString object)])))]
(stack ["Class" (java/lang/Object::toString (java/lang/Object::getClass object))]
["Object" (java/lang/Object::toString object)])))]

[unknown_kind_of_object]
[cannot_apply_a_non_function]
Expand Down Expand Up @@ -297,11 +297,11 @@
(ffi.is org/armedbear/lisp/Closure)))

(the (call_macro inputs lux macro)
(-> (List Code) Lux org/armedbear/lisp/Closure
(Try (Try [Lux (List Code)])))
(-> (Stack Code) Lux org/armedbear/lisp/Closure
(Try (Try [Lux (Stack Code)])))
(do try.monad
[raw_output (org/armedbear/lisp/LispObject::execute (..host_value inputs) (..host_value lux) macro)]
(as (Try (Try [Lux (List Code)]))
(as (Try (Try [Lux (Stack Code)]))
(..read raw_output))))

(the (expander macro inputs lux)
Expand Down Expand Up @@ -367,22 +367,22 @@
(the get_ecl_cli_inputs
(let [@idx (_.var "i")]
(_.call/* (_.var "loop")
(list (_.var "for") @idx
(_.var "from") (_.int +0)
(_.var "below") (_.call/* (_.var "si:argc") (list))
(_.var "collect") (_.call/* (_.var "si:argv") (list @idx))))))
(stack (_.var "for") @idx
(_.var "from") (_.int +0)
(_.var "below") (_.call/* (_.var "si:argc") (stack))
(_.var "collect") (_.call/* (_.var "si:argv") (stack @idx))))))

(the (program context program)
(Program (_.Expression Any) (_.Expression Any))
(let [raw_inputs (_.progn (list (_.conditional+ (list "clisp") (_.var "ext:*args*"))
(_.conditional+ (list "sbcl") (_.var "sb-ext:*posix-argv*"))
(_.conditional+ (list "clozure") (_.call/* (_.var "ccl::command-line-arguments") (list)))
(_.conditional+ (list "gcl") (_.var "si:*command-args*"))
(_.conditional+ (list "ecl") ..get_ecl_cli_inputs)
(_.conditional+ (list "cmu") (_.var "extensions:*command-line-strings*"))
(_.conditional+ (list "allegro") (_.call/* (_.var "sys:command-line-arguments") (list)))
(_.conditional+ (list "lispworks") (_.var "sys:*line-arguments-list*"))
(_.list/* (list))))]
(let [raw_inputs (_.progn (stack (_.conditional+ (stack "clisp") (_.var "ext:*args*"))
(_.conditional+ (stack "sbcl") (_.var "sb-ext:*posix-argv*"))
(_.conditional+ (stack "clozure") (_.call/* (_.var "ccl::command-line-arguments") (stack)))
(_.conditional+ (stack "gcl") (_.var "si:*command-args*"))
(_.conditional+ (stack "ecl") ..get_ecl_cli_inputs)
(_.conditional+ (stack "cmu") (_.var "extensions:*command-line-strings*"))
(_.conditional+ (stack "allegro") (_.call/* (_.var "sys:command-line-arguments") (stack)))
(_.conditional+ (stack "lispworks") (_.var "sys:*line-arguments-list*"))
(_.list/* (stack))))]
(_.call/2 [(runtime.lux//program_args raw_inputs) _.nil] program)))

(for .jvm
Expand Down Expand Up @@ -424,8 +424,8 @@
(_.Expression Any))
(let [@program (_.var "lux_program")]
(all ..then
(_.defun @program (_.args (list)) body)
(_.call/* @program (list))
(_.defun @program (_.args (stack)) body)
(_.call/* @program (stack))
)))

(`` (the _
Expand Down
42 changes: 21 additions & 21 deletions lux-js/source/program.lux
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@
(exception.the (unknown_member [member object])
(Exception [Text java/lang/Object])
(exception.report
(list ["Member" member]
["Object" (debug.inspection object)])))
(stack ["Member" member]
["Object" (debug.inspection object)])))

(the jvm_integer
(-> (I64 Any) java/lang/Integer)
Expand Down Expand Up @@ -327,17 +327,17 @@
(exception.the (unknown_kind_of_host_object object)
(Exception java/lang/Object)
(exception.report
(list ["Class" (ffi.of_string (java/lang/Object::toString [] (java/lang/Object::getClass [] object)))]
["Object" (ffi.of_string (java/lang/Object::toString [] object))]
["Keys" (when (ffi.as org/openjdk/nashorn/api/scripting/ScriptObjectMirror object)
{.#Some object}
(|> object
(org/openjdk/nashorn/api/scripting/ScriptObjectMirror::getOwnKeys [true])
(array.list {.#None})
(%.list (|>> ffi.of_string %.text)))

{.#None}
"???")])))
(stack ["Class" (ffi.of_string (java/lang/Object::toString [] (java/lang/Object::getClass [] object)))]
["Object" (ffi.of_string (java/lang/Object::toString [] object))]
["Keys" (when (ffi.as org/openjdk/nashorn/api/scripting/ScriptObjectMirror object)
{.#Some object}
(|> object
(org/openjdk/nashorn/api/scripting/ScriptObjectMirror::getOwnKeys [true])
(array.stack {.#None})
(%.stack (|>> ffi.of_string %.text)))
{.#None}
"???")])))

(the (i32 half i64)
(-> Text org/openjdk/nashorn/api/scripting/ScriptObjectMirror (Maybe Integer))
Expand Down Expand Up @@ -478,10 +478,10 @@

(for .jvm
(these (the (call_macro inputs lux macro)
(-> (List Code) Lux org/openjdk/nashorn/api/scripting/JSObject (Try (Try [Lux (List Code)])))
(-> (Stack Code) Lux org/openjdk/nashorn/api/scripting/JSObject (Try (Try [Lux (Stack Code)])))
(let [to_js (is (-> Any java/lang/Object)
(|>> (as (Array java/lang/Object)) js_structure (as java/lang/Object)))]
(<| (as (Try (Try [Lux (List Code)])))
(<| (as (Try (Try [Lux (Stack Code)])))
(org/openjdk/nashorn/api/scripting/JSObject::call [{.#None}
(ffi.array java/lang/Object
[(to_js inputs)
Expand All @@ -491,7 +491,7 @@
(exception.the (cannot_apply_a_non_function object)
(Exception java/lang/Object)
(exception.report
(list ["Object" (ffi.of_string (java/lang/Object::toString [] object))])))
(stack ["Object" (ffi.of_string (java/lang/Object::toString [] object))])))

(the (expander macro inputs lux)
Expander
Expand All @@ -502,7 +502,7 @@
(|> output
(as java/lang/Object)
lux_object
(as (Try (Try [Lux (List Code)]))))
(as (Try (Try [Lux (Stack Code)]))))

{try.#Failure error}
{try.#Failure error})
Expand Down Expand Up @@ -671,8 +671,8 @@
(_.and (_.its "argv" @process)))
node_js_inputs (|> @process
(_.its "argv")
(_.do "slice" (list (_.int +2))))
no_inputs (_.array (list))]
(_.do "slice" (stack (_.int +2))))
no_inputs (_.array (stack))]
(_.; (_.apply_1 (_.apply_1 program (runtime.lux//program_args (_.? on_node_js?
node_js_inputs
no_inputs)))
Expand Down Expand Up @@ -718,8 +718,8 @@

(the (scope body)
(-> _.Statement _.Statement)
(_.; (_.apply (_.closure (list) body)
(list))))
(_.; (_.apply (_.closure (stack) body)
(stack))))

(the (lux_compiler it)
(-> Any platform.Custom)
Expand Down
2 changes: 1 addition & 1 deletion lux-jvm/source/program.lux
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
(as java/lang/Object)
(java/lang/Object::getClass [])
(java/lang/Class::getMethod [(ffi.as_string "apply") _apply2_args]))]
(as (Try (Try [Lux (List Code)]))
(as (Try (Try [Lux (Stack Code)]))
(java/lang/reflect/Method::invoke
[(as java/lang/Object macro)
(ffi.array java/lang/Object
Expand Down
Loading

0 comments on commit d278baf

Please sign in to comment.