diff options
author | Eduardo Julian | 2021-07-11 01:51:04 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-07-11 01:51:04 -0400 |
commit | abe24425ced15fd784ef6c62d6f186af72b491db (patch) | |
tree | 42b6e3cbd179c83fae8941fa4b128b13afc766f5 /lux-jvm/source/luxc | |
parent | 4610968193df10af12c91f699fec39aeb3ef703a (diff) |
Re-named ":coerce" to ":as" since it technically doesn't do coercions.
Diffstat (limited to 'lux-jvm/source/luxc')
-rw-r--r-- | lux-jvm/source/luxc/lang/directive/jvm.lux | 12 | ||||
-rw-r--r-- | lux-jvm/source/luxc/lang/translation/jvm/primitive.lux | 10 |
2 files changed, 12 insertions, 10 deletions
diff --git a/lux-jvm/source/luxc/lang/directive/jvm.lux b/lux-jvm/source/luxc/lang/directive/jvm.lux index 7b3235c06..bcd40a1f8 100644 --- a/lux-jvm/source/luxc/lang/directive/jvm.lux +++ b/lux-jvm/source/luxc/lang/directive/jvm.lux @@ -526,9 +526,9 @@ (def: (true_handler extender pseudo) (-> jvm.Extender Any jvm.Handler) (function (_ extension_name phase archive inputs) - (do phase.monad - [bytecode ((extender pseudo) extension_name phase archive inputs)] - (wrap (..bytecode (:coerce (/.Bytecode Inst /.Label) bytecode)))))) + (\ phase.monad map + (|>> (:as (/.Bytecode Inst /.Label)) ..bytecode) + ((extender pseudo) extension_name phase archive inputs)))) (def: (def::generation extender) (-> jvm.Extender @@ -538,13 +538,13 @@ (^ (list nameC valueC)) (do phase.monad [[_ _ name] (lux/.evaluate! archive Text nameC) - [_ handlerV] (lux/.generator archive (:coerce Text name) ..Handler valueC) + [_ handlerV] (lux/.generator archive (:as Text name) ..Handler valueC) _ (|> handlerV (..true_handler extender) - (extension.install extender (:coerce Text name)) + (extension.install extender (:as Text name)) directive.lift_generation) _ (directive.lift_generation - (generation.log! (format "Generation " (%.text (:coerce Text name)))))] + (generation.log! (format "Generation " (%.text (:as Text name)))))] (wrap directive.no_requirements)) _ diff --git a/lux-jvm/source/luxc/lang/translation/jvm/primitive.lux b/lux-jvm/source/luxc/lang/translation/jvm/primitive.lux index 3383e3856..5f3a98b0f 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/primitive.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/primitive.lux @@ -98,12 +98,14 @@ [+5.0 _.ICONST_5]) _ - (let [constantI (if (i.= ..d0-bits - (java/lang/Double::doubleToRawLongBits (:coerce java/lang/Double value))) + (let [constantI (if (|> value + (:as java/lang/Double) + java/lang/Double::doubleToRawLongBits + (i.= ..d0-bits)) _.DCONST_0 (_.double value))] (operation@wrap (|>> constantI (_.wrap type.double)))))) -(def: #export (text value) +(def: #export text (-> Text (Operation Inst)) - (operation@wrap (_.string value))) + (|>> _.string operation@wrap)) |