aboutsummaryrefslogtreecommitdiff
path: root/lux-r
diff options
context:
space:
mode:
authorEduardo Julian2022-06-12 00:38:20 -0400
committerEduardo Julian2022-06-12 00:38:20 -0400
commitb48ea68a83d01903554c7696c77eedaaf1035680 (patch)
treec342d8094c3158de16526f874ca9624418cd2dd2 /lux-r
parent7abf2d0ac55c229a8793bbff31f132596ffcb275 (diff)
De-sigil-ification: suffix : [Part 3]
Diffstat (limited to '')
-rw-r--r--lux-r/source/program.lux8
-rw-r--r--lux-ruby/source/program.lux20
2 files changed, 15 insertions, 13 deletions
diff --git a/lux-r/source/program.lux b/lux-r/source/program.lux
index 1a61a8545..2d4079f48 100644
--- a/lux-r/source/program.lux
+++ b/lux-r/source/program.lux
@@ -171,7 +171,7 @@
(new [])
(getScriptEngine [] org/renjin/script/RenjinScriptEngine))
-(template [<name>]
+(with_template [<name>]
[(exception: (<name> [object java/lang/Object])
(exception.report
"Class" (java/lang/Object::toString (java/lang/Object::getClass object))
@@ -195,7 +195,7 @@
(let [... to_sub (is (-> Any org/armedbear/lisp/LispObject)
... (function (_ sub_value)
... (let [sub_value (as java/lang/Object sub_value)]
- ... (`` (<| (~~ (template [<type> <then>]
+ ... (`` (<| (~~ (with_template [<type> <then>]
... [(case (ffi.as <type> sub_value)
... {.#Some sub_value}
... (`` (|> sub_value (~~ (template.splice <then>))))
@@ -263,7 +263,7 @@
... ("lux io log" (..%%code <call>))
_jvm_this))
- (~~ (template [<call> <output>]
+ (~~ (with_template [<call> <output>]
[(org/renjin/sexp/ListVector
... org/renjin/sexp/AbstractSEXP
... org/renjin/sexp/SEXP
@@ -434,7 +434,7 @@
(..read_tuple read host_object))
{.#None})
- (~~ (template [<class> <post_processing>]
+ (~~ (with_template [<class> <post_processing>]
[(case (ffi.as <class> host_object)
{.#Some host_object}
(`` (|> host_object (~~ (template.splice <post_processing>))))
diff --git a/lux-ruby/source/program.lux b/lux-ruby/source/program.lux
index 16fb31a96..5e06719fa 100644
--- a/lux-ruby/source/program.lux
+++ b/lux-ruby/source/program.lux
@@ -156,14 +156,16 @@
(def: interpreter
(org/jruby/embed/ScriptingContainer::new))
-(template: (!ruby_runtime)
- [(|> ..interpreter
- org/jruby/embed/ScriptingContainer::getProvider
- org/jruby/embed/internal/LocalContextProvider::getRuntime)])
+(def: !ruby_runtime
+ (template (!ruby_runtime)
+ [(|> ..interpreter
+ org/jruby/embed/ScriptingContainer::getProvider
+ org/jruby/embed/internal/LocalContextProvider::getRuntime)]))
-(template: (!ruby_thread_context)
- [(|> (!ruby_runtime)
- org/jruby/Ruby::getCurrentContext)])
+(def: !ruby_thread_context
+ (template (!ruby_thread_context)
+ [(|> (!ruby_runtime)
+ org/jruby/Ruby::getCurrentContext)]))
(def: initial_ruby_runtime
(!ruby_runtime))
@@ -286,7 +288,7 @@
Translator
(`` (<| (if (ffi.null? host_object)
(exception.except ..nil_has_no_lux_representation []))
- (~~ (template [<class> <post_processing>]
+ (~~ (with_template [<class> <post_processing>]
[(case (ffi.as <class> host_object)
{.#Some typed_object}
(`` (|> typed_object (~~ (template.spliced <post_processing>))))
@@ -326,7 +328,7 @@
(-> (Array java/lang/Object) org/jruby/runtime/builtin/IRubyObject)
(-> java/lang/Object org/jruby/runtime/builtin/IRubyObject))
(function (again value)
- (`` (<| (~~ (template [<when> <then>]
+ (`` (<| (~~ (with_template [<when> <then>]
[(case (ffi.as <when> value)
{.#Some value}
(|> value