aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/jvm.lux
diff options
context:
space:
mode:
authorEduardo Julian2019-04-27 23:41:47 -0400
committerEduardo Julian2019-04-27 23:41:47 -0400
commitaf7f85c4eb724f2888ecce9c8b52d6d3bb1cd807 (patch)
tree9d2b80257b5c82ebcc9f17bd32e9771ea51cc708 /new-luxc/source/luxc/lang/translation/jvm.lux
parentaa7f1d12ae98da9726bf8bbdd3c494a671e3f94b (diff)
Moved JVM type machinery to stdlib.
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm.lux41
1 files changed, 22 insertions, 19 deletions
diff --git a/new-luxc/source/luxc/lang/translation/jvm.lux b/new-luxc/source/luxc/lang/translation/jvm.lux
index 61c86ae10..b2822726c 100644
--- a/new-luxc/source/luxc/lang/translation/jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm.lux
@@ -1,10 +1,11 @@
(.module:
- [lux (#- Definition)
+ [lux (#- Type Definition)
+ ["." host (#+ import: do-to object)]
[abstract
[monad (#+ do)]]
[control
pipe
- ["ex" exception (#+ exception:)]
+ ["." exception (#+ exception:)]
["." io (#+ IO io)]
[concurrency
["." atom (#+ Atom atom)]]]
@@ -17,9 +18,10 @@
["." array]
[list ("#/." functor)]
["." dictionary (#+ Dictionary)]]]
- ["." host (#+ import: do-to object)
+ [target
[jvm
- ["." loader (#+ Library)]]]
+ ["." loader (#+ Library)]
+ ["." type (#+ Type)]]]
[world
[binary (#+ Binary)]]
[tool
@@ -28,7 +30,6 @@
[///
[host
["." jvm (#+ Inst Definition Host State)
- ["." type]
["." def]
["." inst]]]]
)
@@ -49,19 +50,22 @@
(type: #export ByteCode Binary)
(def: #export value-field Text "_value")
-(def: #export $Object jvm.Type (type.class "java.lang.Object" (list)))
+(def: #export $Object Type (type.class "java.lang.Object" (list)))
(exception: #export (cannot-load {class Text} {error Text})
- (ex.report ["Class" class]
- ["Error" error]))
+ (exception.report
+ ["Class" class]
+ ["Error" error]))
(exception: #export (invalid-field {class Text} {field Text} {error Text})
- (ex.report ["Class" class]
- ["Field" field]
- ["Error" error]))
+ (exception.report
+ ["Class" class]
+ ["Field" field]
+ ["Error" error]))
(exception: #export (invalid-value {class Text})
- (ex.report ["Class" class]))
+ (exception.report
+ ["Class" class]))
(def: (class-value class-name class)
(-> Text (Class Object) (Error Any))
@@ -74,13 +78,13 @@
(#error.Success value)
#.None
- (ex.throw invalid-value class-name))
+ (exception.throw invalid-value class-name))
(#error.Failure error)
- (ex.throw cannot-load [class-name error]))
+ (exception.throw cannot-load [class-name error]))
(#error.Failure error)
- (ex.throw invalid-field [class-name ..value-field error])))
+ (exception.throw invalid-field [class-name ..value-field error])))
(def: class-path-separator ".")
@@ -147,8 +151,7 @@
(def: #export runtime-class "LuxRuntime")
(def: #export function-class "LuxFunction")
-(def: #export runnable-class "LuxRunnable")
-(def: #export $Variant jvm.Type (type.array 1 ..$Object))
-(def: #export $Tuple jvm.Type (type.array 1 ..$Object))
-(def: #export $Function jvm.Type (type.class ..function-class (list)))
+(def: #export $Variant Type (type.array 1 ..$Object))
+(def: #export $Tuple Type (type.array 1 ..$Object))
+(def: #export $Function Type (type.class ..function-class (list)))