diff options
author | Eduardo Julian | 2019-08-20 22:00:59 -0400 |
---|---|---|
committer | Eduardo Julian | 2019-08-20 22:00:59 -0400 |
commit | 59ededb795732e04ac8e1eaceb2b1509a1c1cc23 (patch) | |
tree | c0498fbae7cd18fa9434c972a6f7e35d0e02b456 /new-luxc/source/luxc/lang/translation/jvm/common.lux | |
parent | cdfda2f80b2abd8ec7d8021aab910ccc82271ade (diff) |
WIP: Make new-luxc instructions rely on the Descriptor type.
Diffstat (limited to '')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/jvm/common.lux | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/new-luxc/source/luxc/lang/translation/jvm/common.lux b/new-luxc/source/luxc/lang/translation/jvm/common.lux index 26dbcfbc8..8b2a83526 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/common.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/common.lux @@ -3,11 +3,11 @@ [abstract [monad (#+ do)]] [control + ["." try (#+ Try)] ["ex" exception (#+ exception:)] ["." io]] [data [binary (#+ Binary)] - ["." error (#+ Error)] ["." text ("#/." hash) format] [collection @@ -34,8 +34,8 @@ ## (set@ #artifacts (dictionary.new text.hash)) ## (:coerce Nothing)) ## state)) -## (#error.Success [state' output]) -## (#error.Success [(update@ #.host +## (#try.Success [state' output]) +## (#try.Success [(update@ #.host ## (|>> (:coerce Host) ## (set@ #artifacts (|> (get@ #.host state) (:coerce Host) (get@ #artifacts))) ## (:coerce Nothing)) @@ -43,11 +43,11 @@ ## [(|> state' (get@ #.host) (:coerce Host) (get@ #artifacts)) ## output]]) -## (#error.Error error) -## (#error.Error error)))) +## (#try.Failure error) +## (#try.Failure error)))) ## (def: #export (load-definition state) -## (-> Lux (-> Name Binary (Error Any))) +## (-> Lux (-> Name Binary (Try Any))) ## (function (_ (^@ def-name [def-module def-name]) def-bytecode) ## (let [normal-name (format (name.normalize def-name) (%n (text/hash def-name))) ## class-name (format (text.replace-all "/" "." def-module) "." normal-name)] @@ -55,16 +55,16 @@ ## (do macro.monad ## [_ (..store-class class-name def-bytecode) ## class (..load-class class-name)] -## (case (do error.monad +## (case (do try.monad ## [field (Class::getField [..value-field] class)] ## (Field::get [#.None] field)) -## (#error.Success (#.Some def-value)) +## (#try.Success (#.Some def-value)) ## (wrap def-value) -## (#error.Success #.None) +## (#try.Success #.None) ## (phase.throw invalid-definition-value (%name def-name)) -## (#error.Error error) +## (#try.Failure error) ## (phase.throw cannot-load-definition ## (format "Definition: " (%name def-name) "\n" ## "Error:\n" |