diff options
author | Eduardo Julian | 2017-07-03 18:15:24 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-07-03 18:15:24 -0400 |
commit | 65c182755954f64fd112284a5336ba05547a4283 (patch) | |
tree | 88ceff9a934883981660a53ca6002029522e0cc6 /new-luxc/source/luxc/host.jvm.lux | |
parent | a7cb1e8d06e62c710c3cdfc4b225e8b4a8c26205 (diff) |
- Tested the compilation for "nat" procedures.
- Expanded the runtime.
- Some bug-fixes and refactorings.
Diffstat (limited to '')
-rw-r--r-- | new-luxc/source/luxc/host.jvm.lux | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/new-luxc/source/luxc/host.jvm.lux b/new-luxc/source/luxc/host.jvm.lux index 37b62b30d..d5b4e89b0 100644 --- a/new-luxc/source/luxc/host.jvm.lux +++ b/new-luxc/source/luxc/host.jvm.lux @@ -57,25 +57,26 @@ ClassLoader::defineClass)) (def: (fetch-byte-code class-name store) - (-> Text &&common;Class-Store &&common;Bytecode) - (|> store A;get io;run (d;get class-name) assume)) - -(def: (assume!! input) - (All [a] (-> (R;Result a) a)) - (case input - (#R;Success output) - output - - (#R;Error error) - (error! error))) + (-> Text &&common;Class-Store (Maybe &&common;Bytecode)) + (|> store A;get io;run (d;get class-name))) (def: (memory-class-loader store) (-> &&common;Class-Store ClassLoader) (object ClassLoader [] [] (ClassLoader (findClass [class-name String]) Class - (:!! (assume!! (define-class class-name (fetch-byte-code class-name store) (:! ClassLoader _jvm_this)))) - ))) + (case (fetch-byte-code class-name store) + (#;Some bytecode) + (case (define-class class-name bytecode (:! ClassLoader _jvm_this)) + (#R;Success class) + (:!! class) + + (#R;Error error) + (error! (format "Class definiton error: " class-name "\n" + error))) + + #;None + (error! (format "Class not found: " class-name)))))) (def: #export (init-host _) (-> Top &&common;Host) |