From da89da48cbe538521790f8a1bdc64ffae21161b5 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 31 Oct 2021 00:40:58 -0400 Subject: Fixed a bug when calling JVM functions from Ruby code. --- stdlib/source/library/lux/target/ruby.lux | 13 ++--- .../tool/compiler/language/lux/phase/analysis.lux | 64 +++++++++++----------- 2 files changed, 36 insertions(+), 41 deletions(-) (limited to 'stdlib') diff --git a/stdlib/source/library/lux/target/ruby.lux b/stdlib/source/library/lux/target/ruby.lux index 8344f1fa9..3a5ac1901 100644 --- a/stdlib/source/library/lux/target/ruby.lux +++ b/stdlib/source/library/lux/target/ruby.lux @@ -220,15 +220,6 @@ (format (:representation func)) :abstraction)) - (def: .public (apply_lambda/* args lambda) - (-> (List Expression) Expression Computation) - (|> args - (list#each (|>> :representation)) - (text.interposed ..input_separator) - (text.enclosed ["[" "]"]) - (format (:representation lambda)) - :abstraction)) - (def: .public (the field object) (-> Text Expression Access) (:abstraction (format (:representation object) "." field))) @@ -425,6 +416,10 @@ (-> Text (List Expression) Expression Computation) (|> object (..the method) (..apply/* args))) +(def: .public (apply_lambda/* args lambda) + (-> (List Expression) Expression Computation) + (..do "call" args lambda)) + (def: .public (cond clauses else!) (-> (List [Expression Statement]) Statement Statement) (list#mix (.function (_ [test then!] next!) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis.lux index dbe208844..9db69a2c3 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis.lux @@ -1,37 +1,37 @@ (.using - [library - [lux "*" - [abstract - [monad {"+" do}]] - [control - ["[0]" exception {"+" exception:}]] - [data - [text - ["%" format {"+" format}]] - [collection - ["[0]" list]]] - [math - [number - ["n" nat]]] - ["[0]" meta - ["[0]" location]]]] - ["[0]" / "_" - ["[1][0]" type] - ["[1][0]" primitive] - ["[1][0]" structure] - ["[1][0]" reference] - ["[1][0]" case] - ["[1][0]" function] + [library + [lux "*" + [abstract + [monad {"+" do}]] + [control + ["[0]" exception {"+" exception:}]] + [data + [text + ["%" format {"+" format}]] + [collection + ["[0]" list]]] + [math + [number + ["n" nat]]] + ["[0]" meta + ["[0]" location]]]] + ["[0]" / "_" + ["[1][0]" type] + ["[1][0]" primitive] + ["[1][0]" structure] + ["[1][0]" reference] + ["[1][0]" case] + ["[1][0]" function] + ["/[1]" // "_" + ["[1][0]" extension] ["/[1]" // "_" - ["[1][0]" extension] - ["/[1]" // "_" - ["/" analysis {"+" Analysis Operation Phase} - ["[1][0]" macro {"+" Expander}]] - [/// - ["//" phase] - ["[0]" reference] - [meta - [archive {"+" Archive}]]]]]]) + ["/" analysis {"+" Analysis Operation Phase} + ["[1][0]" macro {"+" Expander}]] + [/// + ["//" phase] + ["[0]" reference] + [meta + [archive {"+" Archive}]]]]]]) (exception: .public (unrecognized_syntax [code Code]) (exception.report -- cgit v1.2.3