From 53704218a3705132dbe807a8ef54f938809f84d5 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 1 Oct 2022 16:33:20 -0400 Subject: New format for extensions [part 0] --- lux-ruby/source/program.lux | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'lux-ruby') diff --git a/lux-ruby/source/program.lux b/lux-ruby/source/program.lux index b729daa3a..14f5fa2c7 100644 --- a/lux-ruby/source/program.lux +++ b/lux-ruby/source/program.lux @@ -11,7 +11,6 @@ ["[0]" try (.only Try)] ["[0]" exception (.only Exception)] ["[0]" io (.only IO io)] - ["[0]" function] [concurrency ["[0]" async (.only Async)]]] [data @@ -779,6 +778,11 @@ [_ (run! content)] (run! (_.global (reference.artifact context)))))))))) +(def phase_wrapper + phase.Wrapper + (for @.jvm (..host_phase (list)) + @.ruby (|>>))) + (for @.jvm (these (exception.def .public (invaid_phase_application [partial_application arity]) (Exception [(List Any) (List Any)]) (exception.report @@ -924,8 +928,8 @@ (exception.except ..invaid_phase_application [partial_application inputs])))))] (org/jruby/RubyProc::newProc (!ruby_runtime) block ..proc_type))) - (def (extender phase_wrapper) - (-> phase.Wrapper Extender) + (def extender + Extender ... TODO: Stop relying on coercions ASAP. (<| (as Extender) (function (@self handler)) @@ -956,13 +960,6 @@ (-> phase.Wrapper Extender) (as_expected handler))) -(def (phase_wrapper archive) - (-> Archive (runtime.Operation phase.Wrapper)) - (<| phase#in - (as phase.Wrapper) - (for @.jvm (..host_phase (list)) - @.ruby (|>>)))) - (def platform (IO (Platform Register _.Expression _.Statement)) (do io.monad @@ -1005,7 +1002,7 @@ analysis.bundle ..platform generation.bundle - (function.constant extension/bundle.empty) + extension/bundle.empty ..lux_program (reference.constant ruby/reference.system) [Register _.Expression _.Statement] -- cgit v1.2.3