diff options
Diffstat (limited to 'stdlib/source/library/lux/target/jvm/constant.lux')
-rw-r--r-- | stdlib/source/library/lux/target/jvm/constant.lux | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/stdlib/source/library/lux/target/jvm/constant.lux b/stdlib/source/library/lux/target/jvm/constant.lux index f404694ea..516930b9d 100644 --- a/stdlib/source/library/lux/target/jvm/constant.lux +++ b/stdlib/source/library/lux/target/jvm/constant.lux @@ -11,7 +11,7 @@ ["[0]" product] ["[0]" text] ["[0]" binary - ["[1]F" \\format (.only Writer) (.use "[1]#[0]" monoid)]]] + ["[1]F" \\format (.only Format) (.use "[1]#[0]" monoid)]]] [macro ["^" pattern] ["[0]" template]] @@ -36,8 +36,8 @@ (type .public UTF8 Text) -(def utf8_writer - (Writer UTF8) +(def utf8_format + (Format UTF8) binaryF.utf8_16) (primitive .public Class @@ -57,9 +57,9 @@ ..index //index.equivalence)) - (def class_writer - (Writer Class) - (|>> representation //index.writer)) + (def class_format + (Format Class) + (|>> representation //index.format)) ) (import java/lang/Float @@ -112,18 +112,18 @@ [string String (Index UTF8)] ) - (with_template [<writer_name> <type> <write> <writer>] - [(def <writer_name> - (Writer <type>) + (with_template [<format_name> <type> <write> <format>] + [(def <format_name> + (Format <type>) (`` (|>> representation (~~ (template.spliced <write>)) - (~~ (template.spliced <writer>)))))] + (~~ (template.spliced <format>)))))] - [integer_writer Integer [] [binaryF.bits_32]] - [float_writer Float [java/lang/Float::floatToRawIntBits ffi.of_int .i64] [i32.i32 binaryF.bits_32]] - [long_writer Long [] [binaryF.bits_64]] - [double_writer Double [java/lang/Double::doubleToRawLongBits ffi.of_long] [binaryF.bits_64]] - [string_writer String [] [//index.writer]] + [integer_format Integer [] [binaryF.bits_32]] + [float_format Float [java/lang/Float::floatToRawIntBits ffi.of_int .i64] [i32.i32 binaryF.bits_32]] + [long_format Long [] [binaryF.bits_64]] + [double_format Double [java/lang/Double::doubleToRawLongBits ffi.of_long] [binaryF.bits_64]] + [string_format String [] [//index.format]] ) ) @@ -137,21 +137,21 @@ [#class (Index Class) #name_and_type (Index (Name_And_Type of))])) -(with_template [<type> <equivalence> <writer>] +(with_template [<type> <equivalence> <format>] [(def .public <equivalence> (Equivalence (<type> Any)) (all product.equivalence //index.equivalence //index.equivalence)) - (def <writer> - (Writer (<type> Any)) + (def <format> + (Format (<type> Any)) (all binaryF.and - //index.writer - //index.writer))] + //index.format + //index.format))] - [Name_And_Type name_and_type_equivalence name_and_type_writer] - [Reference reference_equivalence reference_writer] + [Name_And_Type name_and_type_equivalence name_and_type_format] + [Reference reference_equivalence reference_format] ) (type .public Constant @@ -223,28 +223,28 @@ ... ) ) -(def .public writer - (Writer Constant) - (with_expansions [<constants> (these [#UTF8 /tag.utf8 ..utf8_writer] - [#Integer /tag.integer ..integer_writer] - [#Float /tag.float ..float_writer] - [#Long /tag.long ..long_writer] - [#Double /tag.double ..double_writer] - [#Class /tag.class ..class_writer] - [#String /tag.string ..string_writer] - [#Field /tag.field ..reference_writer] - [#Method /tag.method ..reference_writer] - [#Interface_Method /tag.interface_method ..reference_writer] - [#Name_And_Type /tag.name_and_type ..name_and_type_writer] +(def .public format + (Format Constant) + (with_expansions [<constants> (these [#UTF8 /tag.utf8 ..utf8_format] + [#Integer /tag.integer ..integer_format] + [#Float /tag.float ..float_format] + [#Long /tag.long ..long_format] + [#Double /tag.double ..double_format] + [#Class /tag.class ..class_format] + [#String /tag.string ..string_format] + [#Field /tag.field ..reference_format] + [#Method /tag.method ..reference_format] + [#Interface_Method /tag.interface_method ..reference_format] + [#Name_And_Type /tag.name_and_type ..name_and_type_format] ... TODO: Method_Handle ... TODO: Method_Type ... TODO: Invoke_Dynamic )] (function (_ value) (case value - (^.with_template [<case> <tag> <writer>] + (^.with_template [<case> <tag> <format>] [{<case> value} - (binaryF#composite (/tag.writer <tag>) - (<writer> value))]) + (binaryF#composite (/tag.format <tag>) + (<format> value))]) (<constants>) )))) |