From dda05bca0956af5e5b3875c4cc36e61aa04772e4 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 12 Sep 2021 00:07:08 -0400 Subject: Made the "#" character great again! --- lux-cl/source/program.lux | 67 ++++++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 33 deletions(-) (limited to 'lux-cl/source') diff --git a/lux-cl/source/program.lux b/lux-cl/source/program.lux index ef9c02b0e..ab1df4ea8 100644 --- a/lux-cl/source/program.lux +++ b/lux-cl/source/program.lux @@ -169,9 +169,10 @@ (let [sub_value (:as java/lang/Object sub_value)] (`` (<| (~~ (template [ ] [(case (ffi.check sub_value) - {#.Some sub_value} + {.#Some sub_value} (`` (|> sub_value (~~ (template.splice )))) - #.None)] + + {.#None})] [[java/lang/Object] [host_value]] [java/lang/Boolean [..host_bit]] @@ -204,10 +205,10 @@ org/armedbear/lisp/LispObject (case (array.read! (|> idx java/lang/Integer::longValue (:as Nat)) (:as (Array java/lang/Object) value)) - {#.Some sub} + {.#Some sub} (to_sub sub) - #.None + {.#None} (org/armedbear/lisp/Nil::NIL)))] [NTH] [SVREF] [elt] @@ -224,7 +225,7 @@ value (read (org/armedbear/lisp/LispObject::NTH +2 host_object))] (wrap [(java/lang/Long::intValue (:as java/lang/Long tag)) (case (ffi.check org/armedbear/lisp/Nil (org/armedbear/lisp/LispObject::NTH +1 host_object)) - {#.Some _} + {.#Some _} (: Any (ffi.null)) _ @@ -239,38 +240,38 @@ (if (n.< size idx) ... TODO: Start using "SVREF" instead of "elt" ASAP (case (read (org/armedbear/lisp/LispObject::elt (.int idx) host_object)) - {#try.Failure error} - {#try.Failure error} + {try.#Failure error} + {try.#Failure error} - {#try.Success member} + {try.#Success member} (recur (++ idx) (array.write! idx (:as Any member) output))) - {#try.Success output})))) + {try.#Success output})))) (def: (read host_object) (Reader org/armedbear/lisp/LispObject) (`` (<| (~~ (template [ ] [(case (ffi.check host_object) - {#.Some host_object} + {.#Some host_object} (`` (|> host_object (~~ (template.splice )))) - #.None)] + {.#None})] - [org/armedbear/lisp/Bignum [org/armedbear/lisp/Bignum::longValue #try.Success]] - [org/armedbear/lisp/Fixnum [org/armedbear/lisp/Fixnum::longValue #try.Success]] - [org/armedbear/lisp/DoubleFloat [org/armedbear/lisp/DoubleFloat::doubleValue #try.Success]] - [org/armedbear/lisp/SimpleString [org/armedbear/lisp/SimpleString::getStringValue #try.Success]] + [org/armedbear/lisp/Bignum [org/armedbear/lisp/Bignum::longValue {try.#Success}]] + [org/armedbear/lisp/Fixnum [org/armedbear/lisp/Fixnum::longValue {try.#Success}]] + [org/armedbear/lisp/DoubleFloat [org/armedbear/lisp/DoubleFloat::doubleValue {try.#Success}]] + [org/armedbear/lisp/SimpleString [org/armedbear/lisp/SimpleString::getStringValue {try.#Success}]] [org/armedbear/lisp/Cons [(read_variant read)]] [org/armedbear/lisp/SimpleVector [(read_tuple read)]] - [org/armedbear/lisp/Nil [(new> {#try.Success false} [])]] - [org/armedbear/lisp/Closure [#try.Success]] - [program/LuxADT [program/LuxADT::getValue #try.Success]])) + [org/armedbear/lisp/Nil [(new> {try.#Success false} [])]] + [org/armedbear/lisp/Closure [{try.#Success}]] + [program/LuxADT [program/LuxADT::getValue {try.#Success}]])) (case (ffi.check org/armedbear/lisp/Symbol host_object) - {#.Some host_object} + {.#Some host_object} (if (same? (org/armedbear/lisp/Symbol::T) host_object) - {#try.Success true} + {try.#Success true} (exception.throw ..unknown_kind_of_object (:as java/lang/Object host_object))) - #.None) + {.#None}) ... else (exception.throw ..unknown_kind_of_object (:as java/lang/Object host_object)) ))) @@ -289,10 +290,10 @@ (def: (expander macro inputs lux) Expander (case (ensure_macro macro) - {#.Some macro} + {.#Some macro} (call_macro inputs lux macro) - #.None + {.#None} (exception.throw ..cannot_apply_a_non_function (:as java/lang/Object macro)))) (def: host @@ -337,11 +338,11 @@ (IO (Platform [_.Tag Register] (_.Expression Any) (_.Expression Any))) (do io.monad [host ..host] - (wrap [#platform.&file_system (file.async file.default) - #platform.host host - #platform.phase common_lisp.generate - #platform.runtime runtime.generate - #platform.write (|>> _.code (\ encoding.utf8 encoded))]))) + (wrap [platform.#&file_system (file.async file.default) + platform.#host host + platform.#phase common_lisp.generate + platform.#runtime runtime.generate + platform.#write (|>> _.code (\ encoding.utf8 encoded))]))) (def: get_ecl_cli_inputs (let [@idx (_.var "i")] @@ -381,7 +382,7 @@ (:as Try) (exec ("lux io log" "TODO: Extender") - {#try.Failure "TODO: Extender"}))) + {try.#Failure "TODO: Extender"}))) @.common_lisp (def: (extender handler) @@ -411,10 +412,10 @@ (do io.monad [platform ..platform] (exec (do promise.monad - [_ (/.compiler [#/static.host @.common_lisp - #/static.host_module_extension extension - #/static.target (/cli.target service) - #/static.artifact_extension extension] + [_ (/.compiler [/static.#host @.common_lisp + /static.#host_module_extension extension + /static.#target (/cli.target service) + /static.#artifact_extension extension] ..expander analysis.bundle (io.io platform) -- cgit v1.2.3