From d99c47989a1047cd24019fd5ce434e701b5d3519 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 7 Feb 2021 04:56:58 -0400 Subject: Mo' updates, less problems. --- lux-lua/source/program.lux | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) (limited to 'lux-lua') diff --git a/lux-lua/source/program.lux b/lux-lua/source/program.lux index 63cc376d8..fc0e15eeb 100644 --- a/lux-lua/source/program.lux +++ b/lux-lua/source/program.lux @@ -120,7 +120,7 @@ (loadTextChunk [net/sandius/rembulan/Variable java/lang/String java/lang/String] - net/sandius/rembulan/runtime/LuaFunction)]) + #try net/sandius/rembulan/runtime/LuaFunction)]) (host.import: net/sandius/rembulan/compiler/CompilerChunkLoader ["#::." @@ -274,15 +274,10 @@ (#try.Success value) (#try.Failure error) - (case (read_tuple read typed_object) - (#try.Success value) - (#try.Success value) + (read_tuple read typed_object)) - (#try.Failure error) - (exception.throw ..unknown_kind_of_object host_object))) - - _ - (exception.throw ..unknown_kind_of_object host_object)) + _) + (exception.throw ..unknown_kind_of_object host_object) ))) (exception: (cannot_apply_a_non_function {object java/lang/Object}) @@ -310,16 +305,17 @@ ## (net/sandius/rembulan/impl/ImmutableTable$Builder::build (net/sandius/rembulan/impl/ImmutableTable$Builder::new)) (:coerce java/lang/Object (lux_structure (:coerce (Array java/lang/Object) lux))))) executor)] - (wrap (|> output (array.read 0) maybe.assume (:coerce java/lang/Object) ..read)))) + (|> output (array.read 0) maybe.assume (:coerce java/lang/Object) ..read))) (def: (expander baggage macro inputs lux) (-> Baggage Expander) (case (..ensure_function macro) (#.Some macro) - (case (call_macro baggage inputs lux macro) + (case (..call_macro baggage inputs lux macro) (#try.Success output) (|> output - (:coerce (Try (Try [Lux (List Code)])))) + (:coerce (Try [Lux (List Code)])) + #try.Success) (#try.Failure error) (#try.Failure error)) @@ -327,8 +323,6 @@ #.None (exception.throw ..cannot_apply_a_non_function (:coerce java/lang/Object macro)))) -(def: separator "___") - (def: host (IO [Baggage (Host _.Expression _.Statement)]) (io (let [runtime_env (net/sandius/rembulan/env/RuntimeEnvironments::system) @@ -342,8 +336,7 @@ run! (: (-> _.Statement (Try Any)) (function (_ code) (do try.monad - [#let [lua_function (net/sandius/rembulan/load/ChunkLoader::loadTextChunk variable "lux compilation" (_.code code) - loader)] + [lua_function (net/sandius/rembulan/load/ChunkLoader::loadTextChunk variable "lux compilation" (_.code code) loader) output (net/sandius/rembulan/exec/DirectCallExecutor::call state_context (:coerce java/lang/Object lua_function) (array.new 0) executor)] (case (array.read 0 output) -- cgit v1.2.3