aboutsummaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
authorEduardo Julian2021-10-31 00:40:58 -0400
committerEduardo Julian2021-10-31 00:40:58 -0400
commitda89da48cbe538521790f8a1bdc64ffae21161b5 (patch)
treeb429d7b27f7a47bcd533c2eaba256222eafe6bc2 /stdlib
parent0e97f0797dfa861441ca0d3d9b8384ebd0b709ca (diff)
Fixed a bug when calling JVM functions from Ruby code.
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/source/library/lux/target/ruby.lux13
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis.lux64
2 files changed, 36 insertions, 41 deletions
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