From af7f85c4eb724f2888ecce9c8b52d6d3bb1cd807 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 27 Apr 2019 23:41:47 -0400 Subject: Moved JVM type machinery to stdlib. --- new-luxc/source/luxc/lang/translation/jvm/function.lux | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'new-luxc/source/luxc/lang/translation/jvm/function.lux') diff --git a/new-luxc/source/luxc/lang/translation/jvm/function.lux b/new-luxc/source/luxc/lang/translation/jvm/function.lux index 0fea18acd..ae876c3fc 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/function.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/function.lux @@ -1,5 +1,5 @@ (.module: - [lux (#- function) + [lux (#- Type function) [abstract ["." monad (#+ do)]] [control @@ -10,6 +10,9 @@ format] [collection ["." list ("#/." functor monoid)]]] + [target + [jvm + ["." type (#+ Type Method)]]] [tool [compiler [analysis (#+ Arity)] @@ -21,7 +24,6 @@ [lang [host ["$" jvm (#+ Label Inst Def Operation Phase) - ["." type] ["." def] ["_" inst]]]]] ["." // @@ -30,22 +32,22 @@ (def: arity-field Text "arity") -(def: $Object $.Type (type.class "java.lang.Object" (list))) +(def: $Object Type (type.class "java.lang.Object" (list))) (def: (poly-arg? arity) (-> Arity Bit) (n/> 1 arity)) (def: (reset-method class) - (-> Text $.Method) + (-> Text Method) (type.method (list) (#.Some (type.class class (list))) (list))) (def: (captured-args env) - (-> (List Variable) (List $.Type)) + (-> (List Variable) (List Type)) (list.repeat (list.size env) $Object)) (def: (init-method env arity) - (-> (List Variable) Arity $.Method) + (-> (List Variable) Arity Method) (if (poly-arg? arity) (type.method (list.concat (list (captured-args env) (list type.int) @@ -158,7 +160,7 @@ _.ARETURN))) (def: function-init-method - $.Method + Method (type.method (list type.int) #.None (list))) (def: (function-init arity env-size) -- cgit v1.2.3