diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/library/lux/ffi.jvm.lux | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/stdlib/source/library/lux/ffi.jvm.lux b/stdlib/source/library/lux/ffi.jvm.lux index 536960c9a..bda7e8484 100644 --- a/stdlib/source/library/lux/ffi.jvm.lux +++ b/stdlib/source/library/lux/ffi.jvm.lux @@ -55,7 +55,7 @@ (|>> type.reflection reflection.reflection)) (template [<name> <class>] - [(def: #export <name> + [(def: .public <name> .Type (#.Primitive <class> #.End))] @@ -70,7 +70,7 @@ ) (template [<name> <class>] - [(def: #export <name> + [(def: .public <name> .Type (#.Primitive (reflection.reflection <class>) #.End))] @@ -124,16 +124,16 @@ ) (template [<name> <op> <from> <to>] - [(template: #export (<name> value) + [(template: .public (<name> value) {#.doc (doc "Type converter." (: <to> (<name> (: <from> foo))))} - (|> value - (: <from>) - "jvm object cast" - <op> - "jvm object cast" - (: <to>)))] + [(|> value + (: <from>) + "jvm object cast" + <op> + "jvm object cast" + (: <to>))])] [byte_to_long "jvm conversion byte-to-long" ..Byte ..Long] @@ -167,11 +167,11 @@ ) (template [<name> <from> <to> <0> <1>] - [(template: #export (<name> value) + [(template: .public (<name> value) {#.doc (doc "Type converter." (: <to> (<name> (: <from> foo))))} - (|> value <0> <1>))] + [(|> value <0> <1>)])] [long_to_char ..Long ..Character ..long_to_int ..int_to_char] [byte_to_int ..Byte ..Integer ..byte_to_long ..long_to_int] @@ -187,18 +187,18 @@ #ManualPrM #AutoPrM) -(type: #export Privacy +(type: .public Privacy #PublicP #PrivateP #ProtectedP #DefaultP) -(type: #export State +(type: .public State #VolatileS #FinalS #DefaultS) -(type: #export Inheritance +(type: .public Inheritance #FinalI #AbstractI #DefaultI) @@ -537,11 +537,11 @@ (<code>.this! (' #abstract)) (in [])))) -(exception: #export (class_names_cannot_contain_periods {name Text}) +(exception: .public (class_names_cannot_contain_periods {name Text}) (exception.report ["Name" (%.text name)])) -(exception: #export (class_name_cannot_be_a_type_variable {name Text} +(exception: .public (class_name_cannot_be_a_type_variable {name Text} {type_vars (List (Type Var))}) (exception.report ["Name" (%.text name)] @@ -575,7 +575,7 @@ (<code>.form (<>.and class_name^ (<>.some (parameter^ type_vars))))))] (in (type.class (name.safe name) parameters)))) -(exception: #export (unexpected_type_variable {name Text} +(exception: .public (unexpected_type_variable {name Text} {type_vars (List (Type Var))}) (exception.report ["Unexpected Type Variable" (%.text name)] @@ -1199,7 +1199,7 @@ (Type Class) (type.class "java.lang.Object" (list))) -(syntax: #export (class: +(syntax: .public (class: {.let [! <>.monad]} {im inheritance_modifier^} {[full_class_name class_vars] (\ ! map parser.declaration ..declaration^)} @@ -1256,7 +1256,7 @@ [(~+ (list\map field_decl$ fields))] [(~+ (list\map (method_def$ fully_qualified_class_name method_parser super fields) methods))])))))) -(syntax: #export (interface: +(syntax: .public (interface: {.let [! <>.monad]} {[full_class_name class_vars] (\ ! map parser.declaration ..declaration^)} {supers (<>.else (list) @@ -1272,7 +1272,7 @@ [(~+ (list\map annotation$ annotations))] (~+ (list\map method_decl$ members))))))) -(syntax: #export (object +(syntax: .public (object {class_vars ..vars^} {super (<>.else $Object (class^ class_vars))} @@ -1298,12 +1298,12 @@ [(~+ (list\map constructor_arg$ constructor_args))] [(~+ (list\map (method_def$ "" (<>.failure "") super (list)) methods))]))))) -(syntax: #export (null) +(syntax: .public (null) {#.doc (doc "Null object reference." (null))} (in (list (` ("jvm object null"))))) -(def: #export (null? obj) +(def: .public (null? obj) {#.doc (doc "Test for null object reference." (= (null? (null)) true) @@ -1312,7 +1312,7 @@ (-> (primitive "java.lang.Object") Bit) ("jvm object null?" obj)) -(syntax: #export (??? expr) +(syntax: .public (??? expr) {#.doc (doc "Takes a (potentially null) ObjectType reference and creates a (Maybe ObjectType) for it." (= (??? (: java/lang/String (null))) #.None) @@ -1324,7 +1324,7 @@ #.None (#.Some (~ g!temp))))))))) -(syntax: #export (!!! expr) +(syntax: .public (!!! expr) {#.doc (doc "Takes a (Maybe ObjectType) and returns a ObjectType." "A #.None would get translated into a (null)." (= (null) @@ -1339,7 +1339,7 @@ ("jvm object null")} (~ expr))))))) -(syntax: #export (check {class (..type^ (list))} +(syntax: .public (check {class (..type^ (list))} {unchecked (<>.maybe <code>.any)}) {#.doc (doc "Checks whether an object is an instance of a particular class." "Caveat emptor: Cannot check for polymorphism, so avoid using parameterized classes." @@ -1366,7 +1366,7 @@ (~ check_code)))))) )))) -(syntax: #export (synchronized lock body) +(syntax: .public (synchronized lock body) {#.doc (doc "Evaluates body, while holding a lock on a given object." (synchronized object_to_be_locked (exec (do_something ___) @@ -1374,7 +1374,7 @@ (finish_the_computation ___))))} (in (list (` ("jvm object synchronized" (~ lock) (~ body)))))) -(syntax: #export (do_to obj {methods (<>.some partial_call^)}) +(syntax: .public (do_to obj {methods (<>.some partial_call^)}) {#.doc (doc "Call a variety of methods on an object. Then, return the object." (do_to object (ClassName::method1 arg0 arg1 arg2) @@ -1739,7 +1739,7 @@ (#.Left _) (meta.failure (format "Unknown class: " class_name))))) -(syntax: #export (import: +(syntax: .public (import: {declaration ..declaration^} {.let [[class_name class_type_vars] (parser.declaration declaration)]} {bundles (<>.some (..bundle class_type_vars))}) @@ -1803,7 +1803,7 @@ (monad.map ! (member_import$ class_type_vars kind declaration)))] (in (list& (class_import$ declaration) (list\join =members))))) -(syntax: #export (array {type (..type^ (list))} +(syntax: .public (array {type (..type^ (list))} size) {#.doc (doc "Create an array of the given type, with the given size." (array java/lang/Object 10))} @@ -1828,7 +1828,7 @@ (in (list (` (: (~ (value_type #ManualPrM (type.array type))) ("jvm array new object" (~ g!size)))))))))) -(exception: #export (cannot_convert_to_jvm_type {type .Type}) +(exception: .public (cannot_convert_to_jvm_type {type .Type}) (exception.report ["Lux Type" (%.type type)])) @@ -1923,7 +1923,7 @@ _ <failure>)))) -(syntax: #export (array_length array) +(syntax: .public (array_length array) {#.doc (doc "Gives the length of an array." (array_length my_array))} (case array @@ -1959,7 +1959,7 @@ (in (list (` (let [(~ g!array) (~ array)] (..array_length (~ g!array))))))))) -(syntax: #export (array_read idx array) +(syntax: .public (array_read idx array) {#.doc (doc "Loads an element from an array." (array_read 10 my_array))} (case array @@ -1997,7 +1997,7 @@ (in (list (` (let [(~ g!array) (~ array)] (..array_read (~ idx) (~ g!array))))))))) -(syntax: #export (array_write idx value array) +(syntax: .public (array_write idx value array) {#.doc (doc "Stores an element into an array." (array_write 10 my_object my_array))} (case array @@ -2036,20 +2036,20 @@ (in (list (` (let [(~ g!array) (~ array)] (..array_write (~ idx) (~ value) (~ g!array))))))))) -(syntax: #export (class_for {type (..type^ (list))}) +(syntax: .public (class_for {type (..type^ (list))}) {#.doc (doc "Loads the class as a java.lang.Class object." (class_for java/lang/String))} (in (list (` ("jvm object class" (~ (code.text (..reflection type)))))))) -(syntax: #export (type {type (..type^ (list))}) +(syntax: .public (type {type (..type^ (list))}) (in (list (..value_type #ManualPrM type)))) -(exception: #export (cannot_cast_to_non_object {type (Type Value)}) +(exception: .public (cannot_cast_to_non_object {type (Type Value)}) (exception.report ["Signature" (..signature type)] ["Reflection" (..reflection type)])) -(syntax: #export (:cast {type (..type^ (list))} +(syntax: .public (:cast {type (..type^ (list))} object) (case [(parser.array? type) (parser.class? type)] |