diff options
Diffstat (limited to '')
55 files changed, 1959 insertions, 1803 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..916ecdb79 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,40 @@ +name: test_everything +on: [push] +jobs: + test_stdlib: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + # Setup Aedifex + - run: wget https://github.com/LuxLang/lux/releases/download/0.6.5/aedifex.jar + - run: mv ./shell/lux.sh ./lux.sh + # Test on the JVM + # https://github.com/actions/setup-java + - uses: actions/setup-java@v2 + with: + distribution: 'temurin' + java-version: '17' + - run: cd ./stdlib/ && ../lux.sh clean && ../lux.sh with jvm with bibliotheca test && cd .. + # Test on Node + - uses: actions/setup-node@v2 + with: + node-version: '14' + - run: cd ./stdlib/ && ../lux.sh clean && ../lux.sh with js with bibliotheca test && cd .. + # Test on Lua + # https://github.com/marketplace/actions/setup-lua-luajit + - uses: xpol/setup-lua@v1 + - run: cd ./stdlib/ && ../lux.sh clean && ../lux.sh with lua with bibliotheca test && cd .. + # Test on Python + # https://github.com/actions/setup-python + - uses: actions/setup-python@v2 + with: + python-version: '3.9' + architecture: 'x64' + - run: cd ./stdlib/ && ../lux.sh clean && ../lux.sh with python with bibliotheca test && cd .. + # Test on Ruby + # https://github.com/actions/setup-ruby + - uses: actions/setup-ruby@v1 + with: + ruby-version: '2.6' + - run: cd ./stdlib/ && ../lux.sh clean && ../lux.sh with ruby with bibliotheca test && cd .. + diff --git a/licentia/source/program/licentia.lux b/licentia/source/program/licentia.lux index e8b4f2bae..74d072067 100644 --- a/licentia/source/program/licentia.lux +++ b/licentia/source/program/licentia.lux @@ -12,42 +12,42 @@ ... Eclipse Public License v2.0: https://www.eclipse.org/legal/epl-2.0/ (.using - [library - [lux "*" - [ffi {"+" import:}] - [program {"+" program:}] - ["[0]" debug] - [abstract - [monad {"+" do}]] - [control - [remember {"+" to_do}] - ["[0]" io {"+" IO} ("[1]#[0]" monad)] - ["[0]" maybe] - ["[0]" try {"+" Try}] - ["[0]" parser - ["<[0]>" cli] - ["<[0]>" json]] - [security - ["!" capability]]] - [data - ["[0]" text - ["%" format {"+" format}] - [encoding - ["[0]" utf8]]] - [format - ["[0]" json]]] - [world - ["[0]" file]]]] - ["[0]" / "_" - ["[1][0]" input] - ["[1][0]" output]]) + [library + [lux "*" + [ffi {"+" import:}] + [program {"+" program:}] + ["[0]" debug] + [abstract + [monad {"+" do}]] + [control + [remember {"+" to_do}] + ["[0]" io {"+" IO} ("[1]#[0]" monad)] + ["[0]" maybe] + ["[0]" try {"+" Try}] + ["[0]" parser + ["<[0]>" cli] + ["<[0]>" json]] + [security + ["!" capability]]] + [data + ["[0]" text + ["%" format {"+" format}] + [encoding + ["[0]" utf8]]] + [format + ["[0]" json]]] + [world + ["[0]" file]]]] + ["[0]" / "_" + ["[1][0]" input] + ["[1][0]" output]]) (with_expansions [<expiry> "2022-04-01"] (to_do <expiry> "Create a short notice to add as a comment to each file in the _.work")) (import: java/lang/String - ["[1]::[0]" - (trim [] java/lang/String)]) + "[1]::[0]" + (trim [] java/lang/String)) (def: default_output_file "LICENSE.txt") diff --git a/lux-cl/source/program.lux b/lux-cl/source/program.lux index 834b2ff38..91571edaf 100644 --- a/lux-cl/source/program.lux +++ b/lux-cl/source/program.lux @@ -63,89 +63,94 @@ ["[1][0]" cli] ["[1][0]" static]]]) -(ffi.import: java/lang/String) +(ffi.import: java/lang/String + "[1]::[0]") (ffi.import: (java/lang/Class a) - ["[1]::[0]" - ("static" forName [java/lang/String] "try" (java/lang/Class java/lang/Object))]) + "[1]::[0]" + ("static" forName [java/lang/String] "try" (java/lang/Class java/lang/Object))) (ffi.import: java/lang/Object - ["[1]::[0]" - (toString [] java/lang/String) - (getClass [] (java/lang/Class java/lang/Object))]) + "[1]::[0]" + (toString [] java/lang/String) + (getClass [] (java/lang/Class java/lang/Object))) (ffi.import: java/lang/Long - ["[1]::[0]" - (intValue [] java/lang/Integer)]) + "[1]::[0]" + (intValue [] java/lang/Integer)) (ffi.import: java/lang/Integer - ["[1]::[0]" - (longValue [] long)]) + "[1]::[0]" + (longValue [] long)) (ffi.import: java/lang/Number - ["[1]::[0]" - (intValue [] java/lang/Integer) - (longValue [] long) - (doubleValue [] double)]) + "[1]::[0]" + (intValue [] java/lang/Integer) + (longValue [] long) + (doubleValue [] double)) (ffi.import: org/armedbear/lisp/LispObject - ["[1]::[0]" - (length [] int) - (NTH [int] org/armedbear/lisp/LispObject) - (SVREF [int] org/armedbear/lisp/LispObject) - (elt [int] org/armedbear/lisp/LispObject) - (execute [org/armedbear/lisp/LispObject org/armedbear/lisp/LispObject] "try" org/armedbear/lisp/LispObject)]) + "[1]::[0]" + (length [] int) + (NTH [int] org/armedbear/lisp/LispObject) + (SVREF [int] org/armedbear/lisp/LispObject) + (elt [int] org/armedbear/lisp/LispObject) + (execute [org/armedbear/lisp/LispObject org/armedbear/lisp/LispObject] "try" org/armedbear/lisp/LispObject)) ... The org/armedbear/lisp/Interpreter must be imported before the ... other ones, because there is an order dependency in their static initialization. (ffi.import: org/armedbear/lisp/Interpreter - ["[1]::[0]" - ("static" getInstance [] org/armedbear/lisp/Interpreter) - ("static" createInstance [] "?" org/armedbear/lisp/Interpreter) - (eval [java/lang/String] "try" org/armedbear/lisp/LispObject)]) + "[1]::[0]" + ("static" getInstance [] org/armedbear/lisp/Interpreter) + ("static" createInstance [] "?" org/armedbear/lisp/Interpreter) + (eval [java/lang/String] "try" org/armedbear/lisp/LispObject)) (ffi.import: org/armedbear/lisp/Symbol - ["[1]::[0]" - ("static" T org/armedbear/lisp/Symbol)]) + "[1]::[0]" + ("static" T org/armedbear/lisp/Symbol)) (ffi.import: org/armedbear/lisp/DoubleFloat - ["[1]::[0]" - (new [double]) - (doubleValue [] double)]) + "[1]::[0]" + (new [double]) + (doubleValue [] double)) (ffi.import: org/armedbear/lisp/SimpleString - ["[1]::[0]" - (new [java/lang/String]) - (getStringValue [] java/lang/String)]) + "[1]::[0]" + (new [java/lang/String]) + (getStringValue [] java/lang/String)) -(ffi.import: org/armedbear/lisp/LispInteger) +(ffi.import: org/armedbear/lisp/LispInteger + "[1]::[0]") (ffi.import: org/armedbear/lisp/Bignum - ["[1]::[0]" - (longValue [] long) - ("static" getInstance [long] org/armedbear/lisp/LispInteger)]) + "[1]::[0]" + (longValue [] long) + ("static" getInstance [long] org/armedbear/lisp/LispInteger)) (ffi.import: org/armedbear/lisp/Fixnum - ["[1]::[0]" - (longValue [] long) - ("static" getInstance [int] org/armedbear/lisp/Fixnum)]) + "[1]::[0]" + (longValue [] long) + ("static" getInstance [int] org/armedbear/lisp/Fixnum)) (ffi.import: org/armedbear/lisp/Nil - ["[1]::[0]" - ("static" NIL org/armedbear/lisp/Symbol)]) + "[1]::[0]" + ("static" NIL org/armedbear/lisp/Symbol)) -(ffi.import: org/armedbear/lisp/SimpleVector) +(ffi.import: org/armedbear/lisp/SimpleVector + "[1]::[0]") -(ffi.import: org/armedbear/lisp/Cons) +(ffi.import: org/armedbear/lisp/Cons + "[1]::[0]") -(ffi.import: org/armedbear/lisp/Closure) +(ffi.import: org/armedbear/lisp/Closure + "[1]::[0]") (ffi.interface: LuxADT (getValue [] java/lang/Object)) (ffi.import: program/LuxADT - ["[1]::[0]" - (getValue [] java/lang/Object)]) + "[1]::[0]" + (getValue [] java/lang/Object)) (template [<name>] [(exception: (<name> [object java/lang/Object]) diff --git a/lux-js/source/program.lux b/lux-js/source/program.lux index 487415185..2e74bf203 100644 --- a/lux-js/source/program.lux +++ b/lux-js/source/program.lux @@ -77,71 +77,75 @@ "???")) (for @.jvm - (as_is (import: java/lang/String) + (as_is (import: java/lang/String + "[1]::[0]") - (import: (java/lang/Class a)) + (import: (java/lang/Class a) + "[1]::[0]") (import: java/lang/Object - ["[1]::[0]" - (toString [] java/lang/String) - (getClass [] (java/lang/Class java/lang/Object))]) + "[1]::[0]" + (toString [] java/lang/String) + (getClass [] (java/lang/Class java/lang/Object))) (import: java/lang/Long - ["[1]::[0]" - (intValue [] int)]) + "[1]::[0]" + (intValue [] int)) (import: java/lang/Integer - ["[1]::[0]" - (longValue [] long)]) + "[1]::[0]" + (longValue [] long)) (import: java/lang/Number - ["[1]::[0]" - (intValue [] int) - (longValue [] long) - (doubleValue [] double)]) + "[1]::[0]" + (intValue [] int) + (longValue [] long) + (doubleValue [] double)) (import: java/util/Arrays - ["[1]::[0]" - ("static" [t] copyOfRange [[t] int int] [t])]) + "[1]::[0]" + ("static" [t] copyOfRange [[t] int int] [t])) (import: javax/script/ScriptEngine - ["[1]::[0]" - (eval [java/lang/String] "try" "?" java/lang/Object)]) + "[1]::[0]" + (eval [java/lang/String] "try" "?" java/lang/Object)) (import: javax/script/ScriptEngineFactory - ["[1]::[0]" - (getScriptEngine [] javax/script/ScriptEngine)]) + "[1]::[0]" + (getScriptEngine [] javax/script/ScriptEngine)) (import: org/openjdk/nashorn/api/scripting/NashornScriptEngineFactory - ["[1]::[0]" - (new [])]) + "[1]::[0]" + (new [])) (import: org/openjdk/nashorn/api/scripting/JSObject - ["[1]::[0]" - (isArray [] boolean) - (isFunction [] boolean) - (getSlot [int] "?" java/lang/Object) - (getMember [java/lang/String] "?" java/lang/Object) - (hasMember [java/lang/String] boolean) - (call ["?" java/lang/Object [java/lang/Object]] "try" java/lang/Object)]) + "[1]::[0]" + (isArray [] boolean) + (isFunction [] boolean) + (getSlot [int] "?" java/lang/Object) + (getMember [java/lang/String] "?" java/lang/Object) + (hasMember [java/lang/String] boolean) + (call ["?" java/lang/Object [java/lang/Object]] "try" java/lang/Object)) - (import: org/openjdk/nashorn/api/scripting/AbstractJSObject) + (import: org/openjdk/nashorn/api/scripting/AbstractJSObject + "[1]::[0]") (import: org/openjdk/nashorn/api/scripting/ScriptObjectMirror - ["[1]::[0]" - (size [] int) - (toString [] java/lang/String) - (getOwnKeys [boolean] [java/lang/String])]) + "[1]::[0]" + (size [] int) + (toString [] java/lang/String) + (getOwnKeys [boolean] [java/lang/String])) - (import: org/openjdk/nashorn/internal/runtime/Undefined) + (import: org/openjdk/nashorn/internal/runtime/Undefined + "[1]::[0]") (template [<name>] [(ffi.interface: <name> (getValue [] java/lang/Object)) (import: <name> - ["[1]::[0]" - (getValue [] java/lang/Object)])] + "[1]::[0]" + (getValue [] java/lang/Object))] [IntValue] [StructureValue] diff --git a/lux-jvm/source/luxc/lang/directive/jvm.lux b/lux-jvm/source/luxc/lang/directive/jvm.lux index a3b28b710..19e98ae20 100644 --- a/lux-jvm/source/luxc/lang/directive/jvm.lux +++ b/lux-jvm/source/luxc/lang/directive/jvm.lux @@ -44,10 +44,9 @@ ["[0]" generation] ["[0]" directive {"+" Requirements}] ["[0]" analysis {"+" Analysis} - ["[0]A" type]] + ["[0]A" type] + ["[0]A" scope]] [phase - [analysis - ["[0]A" scope]] ["[0]" extension ["[0]" bundle] [analysis @@ -69,520 +68,520 @@ [extension ["//G" host]]]]]) -... (import: org/objectweb/asm/Label -... ["[1]::[0]" -... (new [])]) - -... (def: (literal literal) -... (-> /.Literal Inst) -... (case literal -... {/.#Boolean value} (_.boolean value) -... {/.#Int value} (_.int value) -... {/.#Long value} (_.long value) -... {/.#Double value} (_.double value) -... {/.#Char value} (_.char value) -... {/.#String value} (_.string value))) - -... (def: (constant instruction) -... (-> /.Constant Inst) -... (case instruction -... {/.#BIPUSH constant} (_.BIPUSH constant) +(import: org/objectweb/asm/Label + "[1]::[0]" + (new [])) + +(def: (literal literal) + (-> /.Literal Inst) + (case literal + {/.#Boolean value} (_.boolean value) + {/.#Int value} (_.int value) + {/.#Long value} (_.long value) + {/.#Double value} (_.double value) + {/.#Char value} (_.char value) + {/.#String value} (_.string value))) + +(def: (constant instruction) + (-> /.Constant Inst) + (case instruction + {/.#BIPUSH constant} (_.BIPUSH constant) -... {/.#SIPUSH constant} (_.SIPUSH constant) - -... {/.#ICONST_M1} _.ICONST_M1 -... {/.#ICONST_0} _.ICONST_0 -... {/.#ICONST_1} _.ICONST_1 -... {/.#ICONST_2} _.ICONST_2 -... {/.#ICONST_3} _.ICONST_3 -... {/.#ICONST_4} _.ICONST_4 -... {/.#ICONST_5} _.ICONST_5 - -... {/.#LCONST_0} _.LCONST_0 -... {/.#LCONST_1} _.LCONST_1 + {/.#SIPUSH constant} (_.SIPUSH constant) + + {/.#ICONST_M1} _.ICONST_M1 + {/.#ICONST_0} _.ICONST_0 + {/.#ICONST_1} _.ICONST_1 + {/.#ICONST_2} _.ICONST_2 + {/.#ICONST_3} _.ICONST_3 + {/.#ICONST_4} _.ICONST_4 + {/.#ICONST_5} _.ICONST_5 + + {/.#LCONST_0} _.LCONST_0 + {/.#LCONST_1} _.LCONST_1 -... {/.#FCONST_0} _.FCONST_0 -... {/.#FCONST_1} _.FCONST_1 -... {/.#FCONST_2} _.FCONST_2 + {/.#FCONST_0} _.FCONST_0 + {/.#FCONST_1} _.FCONST_1 + {/.#FCONST_2} _.FCONST_2 -... {/.#DCONST_0} _.DCONST_0 -... {/.#DCONST_1} _.DCONST_1 + {/.#DCONST_0} _.DCONST_0 + {/.#DCONST_1} _.DCONST_1 -... {/.#ACONST_NULL} _.NULL - -... {/.#LDC literal} -... (..literal literal) -... )) - -... (def: (int_arithmetic instruction) -... (-> /.Int_Arithmetic Inst) -... (case instruction -... {/.#IADD} _.IADD -... {/.#ISUB} _.ISUB -... {/.#IMUL} _.IMUL -... {/.#IDIV} _.IDIV -... {/.#IREM} _.IREM -... {/.#INEG} _.INEG)) - -... (def: (long_arithmetic instruction) -... (-> /.Long_Arithmetic Inst) -... (case instruction -... {/.#LADD} _.LADD -... {/.#LSUB} _.LSUB -... {/.#LMUL} _.LMUL -... {/.#LDIV} _.LDIV -... {/.#LREM} _.LREM -... {/.#LNEG} _.LNEG)) - -... (def: (float_arithmetic instruction) -... (-> /.Float_Arithmetic Inst) -... (case instruction -... {/.#FADD} _.FADD -... {/.#FSUB} _.FSUB -... {/.#FMUL} _.FMUL -... {/.#FDIV} _.FDIV -... {/.#FREM} _.FREM -... {/.#FNEG} _.FNEG)) - -... (def: (double_arithmetic instruction) -... (-> /.Double_Arithmetic Inst) -... (case instruction -... {/.#DADD} _.DADD -... {/.#DSUB} _.DSUB -... {/.#DMUL} _.DMUL -... {/.#DDIV} _.DDIV -... {/.#DREM} _.DREM -... {/.#DNEG} _.DNEG)) - -... (def: (arithmetic instruction) -... (-> /.Arithmetic Inst) -... (case instruction -... {/.#Int_Arithmetic int_arithmetic} -... (..int_arithmetic int_arithmetic) + {/.#ACONST_NULL} _.NULL + + {/.#LDC literal} + (..literal literal) + )) + +(def: (int_arithmetic instruction) + (-> /.Int_Arithmetic Inst) + (case instruction + {/.#IADD} _.IADD + {/.#ISUB} _.ISUB + {/.#IMUL} _.IMUL + {/.#IDIV} _.IDIV + {/.#IREM} _.IREM + {/.#INEG} _.INEG)) + +(def: (long_arithmetic instruction) + (-> /.Long_Arithmetic Inst) + (case instruction + {/.#LADD} _.LADD + {/.#LSUB} _.LSUB + {/.#LMUL} _.LMUL + {/.#LDIV} _.LDIV + {/.#LREM} _.LREM + {/.#LNEG} _.LNEG)) + +(def: (float_arithmetic instruction) + (-> /.Float_Arithmetic Inst) + (case instruction + {/.#FADD} _.FADD + {/.#FSUB} _.FSUB + {/.#FMUL} _.FMUL + {/.#FDIV} _.FDIV + {/.#FREM} _.FREM + {/.#FNEG} _.FNEG)) + +(def: (double_arithmetic instruction) + (-> /.Double_Arithmetic Inst) + (case instruction + {/.#DADD} _.DADD + {/.#DSUB} _.DSUB + {/.#DMUL} _.DMUL + {/.#DDIV} _.DDIV + {/.#DREM} _.DREM + {/.#DNEG} _.DNEG)) + +(def: (arithmetic instruction) + (-> /.Arithmetic Inst) + (case instruction + {/.#Int_Arithmetic int_arithmetic} + (..int_arithmetic int_arithmetic) -... {/.#Long_Arithmetic long_arithmetic} -... (..long_arithmetic long_arithmetic) + {/.#Long_Arithmetic long_arithmetic} + (..long_arithmetic long_arithmetic) -... {/.#Float_Arithmetic float_arithmetic} -... (..float_arithmetic float_arithmetic) + {/.#Float_Arithmetic float_arithmetic} + (..float_arithmetic float_arithmetic) -... {/.#Double_Arithmetic double_arithmetic} -... (..double_arithmetic double_arithmetic))) - -... (def: (int_bitwise instruction) -... (-> /.Int_Bitwise Inst) -... (case instruction -... {/.#IOR} _.IOR -... {/.#IXOR} _.IXOR -... {/.#IAND} _.IAND -... {/.#ISHL} _.ISHL -... {/.#ISHR} _.ISHR -... {/.#IUSHR} _.IUSHR)) - -... (def: (long_bitwise instruction) -... (-> /.Long_Bitwise Inst) -... (case instruction -... {/.#LOR} _.LOR -... {/.#LXOR} _.LXOR -... {/.#LAND} _.LAND -... {/.#LSHL} _.LSHL -... {/.#LSHR} _.LSHR -... {/.#LUSHR} _.LUSHR)) - -... (def: (bitwise instruction) -... (-> /.Bitwise Inst) -... (case instruction -... {/.#Int_Bitwise int_bitwise} -... (..int_bitwise int_bitwise) + {/.#Double_Arithmetic double_arithmetic} + (..double_arithmetic double_arithmetic))) + +(def: (int_bitwise instruction) + (-> /.Int_Bitwise Inst) + (case instruction + {/.#IOR} _.IOR + {/.#IXOR} _.IXOR + {/.#IAND} _.IAND + {/.#ISHL} _.ISHL + {/.#ISHR} _.ISHR + {/.#IUSHR} _.IUSHR)) + +(def: (long_bitwise instruction) + (-> /.Long_Bitwise Inst) + (case instruction + {/.#LOR} _.LOR + {/.#LXOR} _.LXOR + {/.#LAND} _.LAND + {/.#LSHL} _.LSHL + {/.#LSHR} _.LSHR + {/.#LUSHR} _.LUSHR)) + +(def: (bitwise instruction) + (-> /.Bitwise Inst) + (case instruction + {/.#Int_Bitwise int_bitwise} + (..int_bitwise int_bitwise) -... {/.#Long_Bitwise long_bitwise} -... (..long_bitwise long_bitwise))) - -... (def: (conversion instruction) -... (-> /.Conversion Inst) -... (case instruction -... {/.#I2B} _.I2B -... {/.#I2S} _.I2S -... {/.#I2L} _.I2L -... {/.#I2F} _.I2F -... {/.#I2D} _.I2D -... {/.#I2C} _.I2C - -... {/.#L2I} _.L2I -... {/.#L2F} _.L2F -... {/.#L2D} _.L2D - -... {/.#F2I} _.F2I -... {/.#F2L} _.F2L -... {/.#F2D} _.F2D + {/.#Long_Bitwise long_bitwise} + (..long_bitwise long_bitwise))) + +(def: (conversion instruction) + (-> /.Conversion Inst) + (case instruction + {/.#I2B} _.I2B + {/.#I2S} _.I2S + {/.#I2L} _.I2L + {/.#I2F} _.I2F + {/.#I2D} _.I2D + {/.#I2C} _.I2C + + {/.#L2I} _.L2I + {/.#L2F} _.L2F + {/.#L2D} _.L2D + + {/.#F2I} _.F2I + {/.#F2L} _.F2L + {/.#F2D} _.F2D -... {/.#D2I} _.D2I -... {/.#D2L} _.D2L -... {/.#D2F} _.D2F)) + {/.#D2I} _.D2I + {/.#D2L} _.D2L + {/.#D2F} _.D2F)) -... (def: (array instruction) -... (-> /.Array Inst) -... (case instruction -... {/.#ARRAYLENGTH} _.ARRAYLENGTH +(def: (array instruction) + (-> /.Array Inst) + (case instruction + {/.#ARRAYLENGTH} _.ARRAYLENGTH -... {/.#NEWARRAY type} (_.NEWARRAY type) -... {/.#ANEWARRAY type} (_.ANEWARRAY type) + {/.#NEWARRAY type} (_.NEWARRAY type) + {/.#ANEWARRAY type} (_.ANEWARRAY type) -... {/.#BALOAD} _.BALOAD -... {/.#BASTORE} _.BASTORE + {/.#BALOAD} _.BALOAD + {/.#BASTORE} _.BASTORE -... {/.#SALOAD} _.SALOAD -... {/.#SASTORE} _.SASTORE + {/.#SALOAD} _.SALOAD + {/.#SASTORE} _.SASTORE -... {/.#IALOAD} _.IALOAD -... {/.#IASTORE} _.IASTORE + {/.#IALOAD} _.IALOAD + {/.#IASTORE} _.IASTORE -... {/.#LALOAD} _.LALOAD -... {/.#LASTORE} _.LASTORE + {/.#LALOAD} _.LALOAD + {/.#LASTORE} _.LASTORE -... {/.#FALOAD} _.FALOAD -... {/.#FASTORE} _.FASTORE + {/.#FALOAD} _.FALOAD + {/.#FASTORE} _.FASTORE -... {/.#DALOAD} _.DALOAD -... {/.#DASTORE} _.DASTORE + {/.#DALOAD} _.DALOAD + {/.#DASTORE} _.DASTORE -... {/.#CALOAD} _.CALOAD -... {/.#CASTORE} _.CASTORE - -... {/.#AALOAD} _.AALOAD -... {/.#AASTORE} _.AASTORE)) - -... (def: (object instruction) -... (-> /.Object Inst) -... (case instruction -... (^template [<tag> <inst>] -... [{<tag> class field_name field_type} -... (<inst> class field_name field_type)]) -... ([/.#GETSTATIC _.GETSTATIC] -... [/.#PUTSTATIC _.PUTSTATIC] -... [/.#GETFIELD _.GETFIELD] -... [/.#PUTFIELD _.PUTFIELD]) + {/.#CALOAD} _.CALOAD + {/.#CASTORE} _.CASTORE + + {/.#AALOAD} _.AALOAD + {/.#AASTORE} _.AASTORE)) + +(def: (object instruction) + (-> /.Object Inst) + (case instruction + (^template [<tag> <inst>] + [{<tag> class field_name field_type} + (<inst> class field_name field_type)]) + ([/.#GETSTATIC _.GETSTATIC] + [/.#PUTSTATIC _.PUTSTATIC] + [/.#GETFIELD _.GETFIELD] + [/.#PUTFIELD _.PUTFIELD]) -... {/.#NEW type} (_.NEW type) + {/.#NEW type} (_.NEW type) -... {/.#INSTANCEOF type} (_.INSTANCEOF type) -... {/.#CHECKCAST type} (_.CHECKCAST type) - -... (^template [<tag> <inst>] -... [{<tag> class method_name method_type} -... (<inst> class method_name method_type)]) -... ([/.#INVOKEINTERFACE _.INVOKEINTERFACE] -... [/.#INVOKESPECIAL _.INVOKESPECIAL] -... [/.#INVOKESTATIC _.INVOKESTATIC] -... [/.#INVOKEVIRTUAL _.INVOKEVIRTUAL]) -... )) - -... (def: (local_int instruction) -... (-> /.Local_Int Inst) -... (case instruction -... {/.#ILOAD register} (_.ILOAD register) -... {/.#ISTORE register} (_.ISTORE register))) - -... (def: (local_long instruction) -... (-> /.Local_Long Inst) -... (case instruction -... {/.#LLOAD register} (_.LLOAD register) -... {/.#LSTORE register} (_.LSTORE register))) - -... (def: (local_float instruction) -... (-> /.Local_Float Inst) -... (case instruction -... {/.#FLOAD register} (_.FLOAD register) -... {/.#FSTORE register} (_.FSTORE register))) - -... (def: (local_double instruction) -... (-> /.Local_Double Inst) -... (case instruction -... {/.#DLOAD register} (_.DLOAD register) -... {/.#DSTORE register} (_.DSTORE register))) - -... (def: (local_object instruction) -... (-> /.Local_Object Inst) -... (case instruction -... {/.#ALOAD register} (_.ALOAD register) -... {/.#ASTORE register} (_.ASTORE register))) - -... (def: (local instruction) -... (-> /.Local Inst) -... (case instruction -... {/.#Local_Int instruction} (..local_int instruction) -... {/.#IINC register} (_.IINC register) -... {/.#Local_Long instruction} (..local_long instruction) -... {/.#Local_Float instruction} (..local_float instruction) -... {/.#Local_Double instruction} (..local_double instruction) -... {/.#Local_Object instruction} (..local_object instruction))) - -... (def: (stack instruction) -... (-> /.Stack Inst) -... (case instruction -... {/.#DUP} _.DUP -... {/.#DUP_X1} _.DUP_X1 -... {/.#DUP_X2} _.DUP_X2 -... {/.#DUP2} _.DUP2 -... {/.#DUP2_X1} _.DUP2_X1 -... {/.#DUP2_X2} _.DUP2_X2 -... {/.#SWAP} _.SWAP -... {/.#POP} _.POP -... {/.#POP2} _.POP2)) - -... (def: (comparison instruction) -... (-> /.Comparison Inst) -... (case instruction -... {/.#LCMP} _.LCMP + {/.#INSTANCEOF type} (_.INSTANCEOF type) + {/.#CHECKCAST type} (_.CHECKCAST type) + + (^template [<tag> <inst>] + [{<tag> class method_name method_type} + (<inst> class method_name method_type)]) + ([/.#INVOKEINTERFACE _.INVOKEINTERFACE] + [/.#INVOKESPECIAL _.INVOKESPECIAL] + [/.#INVOKESTATIC _.INVOKESTATIC] + [/.#INVOKEVIRTUAL _.INVOKEVIRTUAL]) + )) + +(def: (local_int instruction) + (-> /.Local_Int Inst) + (case instruction + {/.#ILOAD register} (_.ILOAD register) + {/.#ISTORE register} (_.ISTORE register))) + +(def: (local_long instruction) + (-> /.Local_Long Inst) + (case instruction + {/.#LLOAD register} (_.LLOAD register) + {/.#LSTORE register} (_.LSTORE register))) + +(def: (local_float instruction) + (-> /.Local_Float Inst) + (case instruction + {/.#FLOAD register} (_.FLOAD register) + {/.#FSTORE register} (_.FSTORE register))) + +(def: (local_double instruction) + (-> /.Local_Double Inst) + (case instruction + {/.#DLOAD register} (_.DLOAD register) + {/.#DSTORE register} (_.DSTORE register))) + +(def: (local_object instruction) + (-> /.Local_Object Inst) + (case instruction + {/.#ALOAD register} (_.ALOAD register) + {/.#ASTORE register} (_.ASTORE register))) + +(def: (local instruction) + (-> /.Local Inst) + (case instruction + {/.#Local_Int instruction} (..local_int instruction) + {/.#IINC register} (_.IINC register) + {/.#Local_Long instruction} (..local_long instruction) + {/.#Local_Float instruction} (..local_float instruction) + {/.#Local_Double instruction} (..local_double instruction) + {/.#Local_Object instruction} (..local_object instruction))) + +(def: (stack instruction) + (-> /.Stack Inst) + (case instruction + {/.#DUP} _.DUP + {/.#DUP_X1} _.DUP_X1 + {/.#DUP_X2} _.DUP_X2 + {/.#DUP2} _.DUP2 + {/.#DUP2_X1} _.DUP2_X1 + {/.#DUP2_X2} _.DUP2_X2 + {/.#SWAP} _.SWAP + {/.#POP} _.POP + {/.#POP2} _.POP2)) + +(def: (comparison instruction) + (-> /.Comparison Inst) + (case instruction + {/.#LCMP} _.LCMP -... {/.#FCMPG} _.FCMPG -... {/.#FCMPL} _.FCMPL - -... {/.#DCMPG} _.DCMPG -... {/.#DCMPL} _.DCMPL)) - -... (def: (branching instruction) -... (-> (/.Branching org/objectweb/asm/Label) Inst) -... (case instruction -... {/.#IF_ICMPEQ label} (_.IF_ICMPEQ label) -... {/.#IF_ICMPGE label} (_.IF_ICMPGE label) -... {/.#IF_ICMPGT label} (_.IF_ICMPGT label) -... {/.#IF_ICMPLE label} (_.IF_ICMPLE label) -... {/.#IF_ICMPLT label} (_.IF_ICMPLT label) -... {/.#IF_ICMPNE label} (_.IF_ICMPNE label) -... {/.#IFEQ label} (_.IFEQ label) -... {/.#IFGE label} (_.IFGE label) -... {/.#IFGT label} (_.IFGT label) -... {/.#IFLE label} (_.IFLE label) -... {/.#IFLT label} (_.IFLT label) -... {/.#IFNE label} (_.IFNE label) - -... {/.#TABLESWITCH min max default labels} -... (_.TABLESWITCH min max default labels) + {/.#FCMPG} _.FCMPG + {/.#FCMPL} _.FCMPL + + {/.#DCMPG} _.DCMPG + {/.#DCMPL} _.DCMPL)) + +(def: (branching instruction) + (-> (/.Branching org/objectweb/asm/Label) Inst) + (case instruction + {/.#IF_ICMPEQ label} (_.IF_ICMPEQ label) + {/.#IF_ICMPGE label} (_.IF_ICMPGE label) + {/.#IF_ICMPGT label} (_.IF_ICMPGT label) + {/.#IF_ICMPLE label} (_.IF_ICMPLE label) + {/.#IF_ICMPLT label} (_.IF_ICMPLT label) + {/.#IF_ICMPNE label} (_.IF_ICMPNE label) + {/.#IFEQ label} (_.IFEQ label) + {/.#IFGE label} (_.IFGE label) + {/.#IFGT label} (_.IFGT label) + {/.#IFLE label} (_.IFLE label) + {/.#IFLT label} (_.IFLT label) + {/.#IFNE label} (_.IFNE label) + + {/.#TABLESWITCH min max default labels} + (_.TABLESWITCH min max default labels) -... {/.#LOOKUPSWITCH default keys+labels} -... (_.LOOKUPSWITCH default keys+labels) - -... {/.#IF_ACMPEQ label} (_.IF_ACMPEQ label) -... {/.#IF_ACMPNE label} (_.IF_ACMPNE label) -... {/.#IFNONNULL label} (_.IFNONNULL label) -... {/.#IFNULL label} (_.IFNULL label))) - -... (def: (exception instruction) -... (-> (/.Exception org/objectweb/asm/Label) Inst) -... (case instruction -... {/.#Try start end handler exception} (_.try start end handler exception) -... {/.#ATHROW} _.ATHROW)) - -... (def: (concurrency instruction) -... (-> /.Concurrency Inst) -... (case instruction -... {/.#MONITORENTER} _.MONITORENTER -... {/.#MONITOREXIT} _.MONITOREXIT)) - -... (def: (return instruction) -... (-> /.Return Inst) -... (case instruction -... {/.#RETURN} _.RETURN -... {/.#IRETURN} _.IRETURN -... {/.#LRETURN} _.LRETURN -... {/.#FRETURN} _.FRETURN -... {/.#DRETURN} _.DRETURN -... {/.#ARETURN} _.ARETURN)) - -... (def: (control instruction) -... (-> (/.Control org/objectweb/asm/Label) Inst) -... (case instruction -... {/.#GOTO label} (_.GOTO label) -... {/.#Branching instruction} (..branching instruction) -... {/.#Exception instruction} (..exception instruction) -... {/.#Concurrency instruction} (..concurrency instruction) -... {/.#Return instruction} (..return instruction))) - -... (def: (instruction instruction) -... (-> (/.Instruction Inst org/objectweb/asm/Label) Inst) -... (case instruction -... {/.#NOP} _.NOP -... {/.#Constant instruction} (..constant instruction) -... {/.#Arithmetic instruction} (..arithmetic instruction) -... {/.#Bitwise instruction} (..bitwise instruction) -... {/.#Conversion instruction} (..conversion instruction) -... {/.#Array instruction} (..array instruction) -... {/.#Object instruction} (..object instruction) -... {/.#Local instruction} (..local instruction) -... {/.#Stack instruction} (..stack instruction) -... {/.#Comparison instruction} (..comparison instruction) -... {/.#Control instruction} (..control instruction) -... {/.#Embedded embedded} embedded)) - -... (type: Mapping -... (Dictionary /.Label org/objectweb/asm/Label)) - -... (type: (Re_labeler context) -... (-> [Mapping (context /.Label)] -... [Mapping (context org/objectweb/asm/Label)])) - -... (def: (relabel [mapping label]) -... (Re_labeler Identity) -... (case (dictionary.value label mapping) -... {.#Some label} -... [mapping label] - -... {.#None} -... (let [label' (org/objectweb/asm/Label::new)] -... [(dictionary.has label label' mapping) label']))) - -... (def: (relabel_branching [mapping instruction]) -... (Re_labeler /.Branching) -... (case instruction -... (^template [<tag>] -... [{<tag> label} -... (let [[mapping label] (..relabel [mapping label])] -... [mapping {<tag> label}])]) -... ([/.#IF_ICMPEQ] [/.#IF_ICMPGE] [/.#IF_ICMPGT] [/.#IF_ICMPLE] [/.#IF_ICMPLT] [/.#IF_ICMPNE] -... [/.#IFEQ] [/.#IFNE] [/.#IFGE] [/.#IFGT] [/.#IFLE] [/.#IFLT] - -... [/.#IF_ACMPEQ] [/.#IF_ACMPNE] [/.#IFNONNULL] [/.#IFNULL]) - -... {/.#TABLESWITCH min max default labels} -... (let [[mapping default] (..relabel [mapping default]) -... [mapping labels] (list#mix (function (_ input [mapping output]) -... (let [[mapping input] (..relabel [mapping input])] -... [mapping (list& input output)])) -... [mapping (list)] labels)] -... [mapping {/.#TABLESWITCH min max default (list.reversed labels)}]) + {/.#LOOKUPSWITCH default keys+labels} + (_.LOOKUPSWITCH default keys+labels) + + {/.#IF_ACMPEQ label} (_.IF_ACMPEQ label) + {/.#IF_ACMPNE label} (_.IF_ACMPNE label) + {/.#IFNONNULL label} (_.IFNONNULL label) + {/.#IFNULL label} (_.IFNULL label))) + +(def: (exception instruction) + (-> (/.Exception org/objectweb/asm/Label) Inst) + (case instruction + {/.#Try start end handler exception} (_.try start end handler exception) + {/.#ATHROW} _.ATHROW)) + +(def: (concurrency instruction) + (-> /.Concurrency Inst) + (case instruction + {/.#MONITORENTER} _.MONITORENTER + {/.#MONITOREXIT} _.MONITOREXIT)) + +(def: (return instruction) + (-> /.Return Inst) + (case instruction + {/.#RETURN} _.RETURN + {/.#IRETURN} _.IRETURN + {/.#LRETURN} _.LRETURN + {/.#FRETURN} _.FRETURN + {/.#DRETURN} _.DRETURN + {/.#ARETURN} _.ARETURN)) + +(def: (control instruction) + (-> (/.Control org/objectweb/asm/Label) Inst) + (case instruction + {/.#GOTO label} (_.GOTO label) + {/.#Branching instruction} (..branching instruction) + {/.#Exception instruction} (..exception instruction) + {/.#Concurrency instruction} (..concurrency instruction) + {/.#Return instruction} (..return instruction))) + +(def: (instruction instruction) + (-> (/.Instruction Inst org/objectweb/asm/Label) Inst) + (case instruction + {/.#NOP} _.NOP + {/.#Constant instruction} (..constant instruction) + {/.#Arithmetic instruction} (..arithmetic instruction) + {/.#Bitwise instruction} (..bitwise instruction) + {/.#Conversion instruction} (..conversion instruction) + {/.#Array instruction} (..array instruction) + {/.#Object instruction} (..object instruction) + {/.#Local instruction} (..local instruction) + {/.#Stack instruction} (..stack instruction) + {/.#Comparison instruction} (..comparison instruction) + {/.#Control instruction} (..control instruction) + {/.#Embedded embedded} embedded)) + +(type: Mapping + (Dictionary /.Label org/objectweb/asm/Label)) + +(type: (Re_labeler context) + (-> [Mapping (context /.Label)] + [Mapping (context org/objectweb/asm/Label)])) + +(def: (relabel [mapping label]) + (Re_labeler Identity) + (case (dictionary.value label mapping) + {.#Some label} + [mapping label] + + {.#None} + (let [label' (org/objectweb/asm/Label::new)] + [(dictionary.has label label' mapping) label']))) + +(def: (relabel_branching [mapping instruction]) + (Re_labeler /.Branching) + (case instruction + (^template [<tag>] + [{<tag> label} + (let [[mapping label] (..relabel [mapping label])] + [mapping {<tag> label}])]) + ([/.#IF_ICMPEQ] [/.#IF_ICMPGE] [/.#IF_ICMPGT] [/.#IF_ICMPLE] [/.#IF_ICMPLT] [/.#IF_ICMPNE] + [/.#IFEQ] [/.#IFNE] [/.#IFGE] [/.#IFGT] [/.#IFLE] [/.#IFLT] + + [/.#IF_ACMPEQ] [/.#IF_ACMPNE] [/.#IFNONNULL] [/.#IFNULL]) + + {/.#TABLESWITCH min max default labels} + (let [[mapping default] (..relabel [mapping default]) + [mapping labels] (list#mix (function (_ input [mapping output]) + (let [[mapping input] (..relabel [mapping input])] + [mapping (list& input output)])) + [mapping (list)] labels)] + [mapping {/.#TABLESWITCH min max default (list.reversed labels)}]) -... {/.#LOOKUPSWITCH default keys+labels} -... (let [[mapping default] (..relabel [mapping default]) -... [mapping keys+labels] (list#mix (function (_ [expected input] [mapping output]) -... (let [[mapping input] (..relabel [mapping input])] -... [mapping (list& [expected input] output)])) -... [mapping (list)] keys+labels)] -... [mapping {/.#LOOKUPSWITCH default (list.reversed keys+labels)}]) -... )) - -... (def: (relabel_exception [mapping instruction]) -... (Re_labeler /.Exception) -... (case instruction -... {/.#Try start end handler exception} -... (let [[mapping start] (..relabel [mapping start]) -... [mapping end] (..relabel [mapping end]) -... [mapping handler] (..relabel [mapping handler])] -... [mapping {/.#Try start end handler exception}]) + {/.#LOOKUPSWITCH default keys+labels} + (let [[mapping default] (..relabel [mapping default]) + [mapping keys+labels] (list#mix (function (_ [expected input] [mapping output]) + (let [[mapping input] (..relabel [mapping input])] + [mapping (list& [expected input] output)])) + [mapping (list)] keys+labels)] + [mapping {/.#LOOKUPSWITCH default (list.reversed keys+labels)}]) + )) + +(def: (relabel_exception [mapping instruction]) + (Re_labeler /.Exception) + (case instruction + {/.#Try start end handler exception} + (let [[mapping start] (..relabel [mapping start]) + [mapping end] (..relabel [mapping end]) + [mapping handler] (..relabel [mapping handler])] + [mapping {/.#Try start end handler exception}]) -... {/.#ATHROW} -... [mapping {/.#ATHROW}] -... )) - -... (def: (relabel_control [mapping instruction]) -... (Re_labeler /.Control) -... (case instruction -... (^template [<tag> <relabel>] -... [{<tag> instruction} -... (let [[mapping instruction] (<relabel> [mapping instruction])] -... [mapping {<tag> instruction}])]) -... ([/.#GOTO ..relabel] -... [/.#Branching ..relabel_branching] -... [/.#Exception ..relabel_exception]) - -... (^template [<tag>] -... [{<tag> instruction} -... [mapping {<tag> instruction}]]) -... ([/.#Concurrency] [/.#Return]) -... )) - -... (def: (relabel_instruction [mapping instruction]) -... (Re_labeler (/.Instruction Inst)) -... (case instruction -... {/.#Embedded embedded} -... [mapping {/.#Embedded embedded}] - -... {/.#NOP} -... [mapping {/.#NOP}] - -... (^template [<tag>] -... [{<tag> instruction} -... [mapping {<tag> instruction}]]) -... ([/.#Constant] -... [/.#Arithmetic] -... [/.#Bitwise] -... [/.#Conversion] -... [/.#Array] -... [/.#Object] -... [/.#Local] -... [/.#Stack] -... [/.#Comparison]) + {/.#ATHROW} + [mapping {/.#ATHROW}] + )) + +(def: (relabel_control [mapping instruction]) + (Re_labeler /.Control) + (case instruction + (^template [<tag> <relabel>] + [{<tag> instruction} + (let [[mapping instruction] (<relabel> [mapping instruction])] + [mapping {<tag> instruction}])]) + ([/.#GOTO ..relabel] + [/.#Branching ..relabel_branching] + [/.#Exception ..relabel_exception]) + + (^template [<tag>] + [{<tag> instruction} + [mapping {<tag> instruction}]]) + ([/.#Concurrency] [/.#Return]) + )) + +(def: (relabel_instruction [mapping instruction]) + (Re_labeler (/.Instruction Inst)) + (case instruction + {/.#Embedded embedded} + [mapping {/.#Embedded embedded}] + + {/.#NOP} + [mapping {/.#NOP}] + + (^template [<tag>] + [{<tag> instruction} + [mapping {<tag> instruction}]]) + ([/.#Constant] + [/.#Arithmetic] + [/.#Bitwise] + [/.#Conversion] + [/.#Array] + [/.#Object] + [/.#Local] + [/.#Stack] + [/.#Comparison]) -... {/.#Control instruction} -... (let [[mapping instruction] (..relabel_control [mapping instruction])] -... [mapping {/.#Control instruction}]))) - -... (def: (relabel_bytecode [mapping bytecode]) -... (Re_labeler (/.Bytecode Inst)) -... (sequence#mix (function (_ input [mapping output]) -... (let [[mapping input'] (..relabel_instruction [mapping input])] -... [mapping (sequence.suffix input' output)])) -... [mapping (sequence.sequence)] -... bytecode)) - -... (def: fresh -... Mapping -... (dictionary.empty nat.hash)) - -... (def: bytecode -... (-> (/.Bytecode Inst /.Label) jvm.Inst) -... (|>> [..fresh] -... ..relabel_bytecode -... product.right -... (sequence#each ..instruction) -... sequence.list -... _.fuse)) - -... (with_expansions [<anchor> (as_is jvm.Anchor) -... <expression> (as_is Inst) -... <directive> (as_is jvm.Definition) -... <type_vars> (as_is <anchor> <expression> <directive>)] -... (type: Handler' -... ... (generation.Handler jvm.Anchor (/.Bytecode Inst /.Label) jvm.Definition) -... (-> extension.Name -... (phase.Phase [(extension.Bundle <type_vars>) -... (generation.State <type_vars>)] -... Synthesis -... <expression>) -... (phase.Phase [(extension.Bundle <type_vars>) -... (generation.State <type_vars>)] -... (List Synthesis) -... (/.Bytecode Inst /.Label))))) - -... (def: (true_handler extender pseudo) -... (-> jvm.Extender Any jvm.Handler) -... (function (_ extension_name phase archive inputs) -... (# phase.monad each -... (|>> (:as (/.Bytecode Inst /.Label)) ..bytecode) -... ((extender pseudo) extension_name phase archive inputs)))) - -... (type: Phase (directive.Phase jvm.Anchor jvm.Inst jvm.Definition)) -... (type: Operation (directive.Operation jvm.Anchor jvm.Inst jvm.Definition)) -... (type: Handler (directive.Handler jvm.Anchor jvm.Inst jvm.Definition)) - -... (def: (def::generation extender) -... (-> jvm.Extender ..Handler) -... (function (handler extension_name phase archive inputsC+) -... (case inputsC+ -... (^ (list nameC valueC)) -... (do phase.monad -... [[_ _ name] (lux/.evaluate! archive Text nameC) -... [_ handlerV] (lux/.generator archive (:as Text name) ..Handler' valueC) -... _ (|> handlerV -... (..true_handler extender) -... (extension.install extender (:as Text name)) -... directive.lifted_generation) -... _ (directive.lifted_generation -... (generation.log! (format "Generation " (%.text (:as Text name)))))] -... (in directive.no_requirements)) - -... _ -... (phase.except extension.invalid_syntax [extension_name %.code inputsC+])))) + {/.#Control instruction} + (let [[mapping instruction] (..relabel_control [mapping instruction])] + [mapping {/.#Control instruction}]))) + +(def: (relabel_bytecode [mapping bytecode]) + (Re_labeler (/.Bytecode Inst)) + (sequence#mix (function (_ input [mapping output]) + (let [[mapping input'] (..relabel_instruction [mapping input])] + [mapping (sequence.suffix input' output)])) + [mapping (sequence.sequence)] + bytecode)) + +(def: fresh + Mapping + (dictionary.empty nat.hash)) + +(def: bytecode + (-> (/.Bytecode Inst /.Label) jvm.Inst) + (|>> [..fresh] + ..relabel_bytecode + product.right + (sequence#each ..instruction) + sequence.list + _.fuse)) + +(with_expansions [<anchor> (as_is jvm.Anchor) + <expression> (as_is Inst) + <directive> (as_is jvm.Definition) + <type_vars> (as_is <anchor> <expression> <directive>)] + (type: Handler' + ... (generation.Handler jvm.Anchor (/.Bytecode Inst /.Label) jvm.Definition) + (-> extension.Name + (phase.Phase [(extension.Bundle <type_vars>) + (generation.State <type_vars>)] + Synthesis + <expression>) + (phase.Phase [(extension.Bundle <type_vars>) + (generation.State <type_vars>)] + (List Synthesis) + (/.Bytecode Inst /.Label))))) + +(def: (true_handler extender pseudo) + (-> jvm.Extender Any jvm.Handler) + (function (_ extension_name phase archive inputs) + (# phase.monad each + (|>> (:as (/.Bytecode Inst /.Label)) ..bytecode) + ((extender pseudo) extension_name phase archive inputs)))) + +(type: Phase (directive.Phase jvm.Anchor jvm.Inst jvm.Definition)) +(type: Operation (directive.Operation jvm.Anchor jvm.Inst jvm.Definition)) +(type: Handler (directive.Handler jvm.Anchor jvm.Inst jvm.Definition)) + +(def: (def::generation extender) + (-> jvm.Extender ..Handler) + (function (handler extension_name phase archive inputsC+) + (case inputsC+ + (^ (list nameC valueC)) + (do phase.monad + [[_ _ name] (lux/.evaluate! archive Text nameC) + [_ handlerV] (lux/.generator archive (:as Text name) ..Handler' valueC) + _ (|> handlerV + (..true_handler extender) + (extension.install extender (:as Text name)) + directive.lifted_generation) + _ (directive.lifted_generation + (generation.log! (format "Generation " (%.text (:as Text name)))))] + (in directive.no_requirements)) + + _ + (phase.except extension.invalid_syntax [extension_name %.code inputsC+])))) (def: .public (custom [parser handler]) (All (_ i) @@ -1070,7 +1069,7 @@ list.reversed (list#mix scopeA.with_local (analyse archive bodyC)) (typeA.expecting returnT) - analysis.with_scope)] + scopeA.with)] (in [privacy strict_floating_point? annotations method_tvars exceptions self arguments constructor_argumentsA bodyA]))))) @@ -1100,7 +1099,7 @@ list.reversed (list#mix scopeA.with_local (analyse archive bodyC)) (typeA.expecting returnT) - analysis.with_scope)] + scopeA.with)] (in [[super_name super_tvars] method_name strict_floating_point? annotations method_tvars self arguments returnJ exceptionsJ bodyA]))))) @@ -1128,7 +1127,7 @@ list.reversed (list#mix scopeA.with_local (analyse archive bodyC)) (typeA.expecting returnT) - analysis.with_scope)] + scopeA.with)] (in [name privacy final? strict_floating_point? annotations method_tvars self arguments returnJ exceptionsJ bodyA]))))) @@ -1153,7 +1152,7 @@ list.reversed (list#mix scopeA.with_local (analyse archive bodyC)) (typeA.expecting returnT) - analysis.with_scope)] + scopeA.with)] (in [name privacy strict_floating_point? annotations method_tvars arguments returnJ exceptionsJ bodyA]))))) @@ -1516,6 +1515,6 @@ (def: .public (bundle class_loader extender) (-> java/lang/ClassLoader jvm.Extender (directive.Bundle jvm.Anchor jvm.Inst jvm.Definition)) (|> bundle.empty - ... (dictionary.has "lux def generation" (..def::generation extender)) + (dictionary.has "lux def generation" (..def::generation extender)) (dictionary.has "jvm class" (..jvm::class class_loader)) (dictionary.has "jvm class interface" ..jvm::class::interface))) diff --git a/lux-jvm/source/luxc/lang/host/jvm.lux b/lux-jvm/source/luxc/lang/host/jvm.lux index 017dd834a..dc942529d 100644 --- a/lux-jvm/source/luxc/lang/host/jvm.lux +++ b/lux-jvm/source/luxc/lang/host/jvm.lux @@ -30,13 +30,15 @@ [meta [archive {"+" Archive}]]]]]]) -(import: org/objectweb/asm/MethodVisitor) +(import: org/objectweb/asm/MethodVisitor + "[1]::[0]") -(import: org/objectweb/asm/ClassWriter) +(import: org/objectweb/asm/ClassWriter + "[1]::[0]") (import: org/objectweb/asm/Label - ["[1]::[0]" - (new [])]) + "[1]::[0]" + (new [])) (type: .public Def (-> org/objectweb/asm/ClassWriter org/objectweb/asm/ClassWriter)) diff --git a/lux-jvm/source/luxc/lang/host/jvm/def.lux b/lux-jvm/source/luxc/lang/host/jvm/def.lux index e7174a61e..fd79d2119 100644 --- a/lux-jvm/source/luxc/lang/host/jvm/def.lux +++ b/lux-jvm/source/luxc/lang/host/jvm/def.lux @@ -28,56 +28,59 @@ (def: descriptor (|>> type.descriptor descriptor.descriptor)) (def: class_name (|>> type.descriptor descriptor.class_name name.read)) -(import: java/lang/Object) -(import: java/lang/String) +(import: java/lang/Object + "[1]::[0]") + +(import: java/lang/String + "[1]::[0]") (import: org/objectweb/asm/Opcodes - ["[1]::[0]" - ("static" ACC_PUBLIC int) - ("static" ACC_PROTECTED int) - ("static" ACC_PRIVATE int) - - ("static" ACC_TRANSIENT int) - ("static" ACC_VOLATILE int) - - ("static" ACC_ABSTRACT int) - ("static" ACC_FINAL int) - ("static" ACC_STATIC int) - ("static" ACC_SYNCHRONIZED int) - ("static" ACC_STRICT int) - - ("static" ACC_SUPER int) - ("static" ACC_INTERFACE int) - - ("static" V1_1 int) - ("static" V1_2 int) - ("static" V1_3 int) - ("static" V1_4 int) - ("static" V1_5 int) - ("static" V1_6 int) - ("static" V1_7 int) - ("static" V1_8 int)]) + "[1]::[0]" + ("static" ACC_PUBLIC int) + ("static" ACC_PROTECTED int) + ("static" ACC_PRIVATE int) + + ("static" ACC_TRANSIENT int) + ("static" ACC_VOLATILE int) + + ("static" ACC_ABSTRACT int) + ("static" ACC_FINAL int) + ("static" ACC_STATIC int) + ("static" ACC_SYNCHRONIZED int) + ("static" ACC_STRICT int) + + ("static" ACC_SUPER int) + ("static" ACC_INTERFACE int) + + ("static" V1_1 int) + ("static" V1_2 int) + ("static" V1_3 int) + ("static" V1_4 int) + ("static" V1_5 int) + ("static" V1_6 int) + ("static" V1_7 int) + ("static" V1_8 int)) (import: org/objectweb/asm/FieldVisitor - ["[1]::[0]" - (visitEnd [] void)]) + "[1]::[0]" + (visitEnd [] void)) (import: org/objectweb/asm/MethodVisitor - ["[1]::[0]" - (visitCode [] void) - (visitMaxs [int int] void) - (visitEnd [] void)]) + "[1]::[0]" + (visitCode [] void) + (visitMaxs [int int] void) + (visitEnd [] void)) (import: org/objectweb/asm/ClassWriter - ["[1]::[0]" - ("static" COMPUTE_MAXS int) - ("static" COMPUTE_FRAMES int) - (new [int]) - (visit [int int java/lang/String java/lang/String java/lang/String [java/lang/String]] void) - (visitEnd [] void) - (visitField [int java/lang/String java/lang/String java/lang/String java/lang/Object] org/objectweb/asm/FieldVisitor) - (visitMethod [int java/lang/String java/lang/String java/lang/String [java/lang/String]] org/objectweb/asm/MethodVisitor) - (toByteArray [] [byte])]) + "[1]::[0]" + ("static" COMPUTE_MAXS int) + ("static" COMPUTE_FRAMES int) + (new [int]) + (visit [int int java/lang/String java/lang/String java/lang/String [java/lang/String]] void) + (visitEnd [] void) + (visitField [int java/lang/String java/lang/String java/lang/String java/lang/Object] org/objectweb/asm/FieldVisitor) + (visitMethod [int java/lang/String java/lang/String java/lang/String [java/lang/String]] org/objectweb/asm/MethodVisitor) + (toByteArray [] [byte])) (def: (string_array values) (-> (List Text) (Array Text)) diff --git a/lux-jvm/source/luxc/lang/host/jvm/inst.lux b/lux-jvm/source/luxc/lang/host/jvm/inst.lux index 7af807189..8b75e4169 100644 --- a/lux-jvm/source/luxc/lang/host/jvm/inst.lux +++ b/lux-jvm/source/luxc/lang/host/jvm/inst.lux @@ -1,48 +1,51 @@ (.using - [library - [lux {"-" Type Primitive int char try} - ["[0]" ffi {"+" import: do_to}] - [abstract - [monad {"+" do}]] - [control - ["[0]" function] - ["[0]" maybe] - ["[0]" try] - ["p" parser - ["s" code]]] - [data - ["[0]" product] - [collection - ["[0]" list ("[1]@[0]" functor)]]] - [macro - [syntax {"+" syntax:}] - ["[0]" code] - ["[0]" template]] - [math - [number - ["n" nat] - ["i" int]]] - [target - [jvm - [encoding - ["[0]" name {"+" External}]] - ["[0]" type {"+" Type} ("[1]@[0]" equivalence) - [category {"+" Void Value Return Method Primitive Object Class Array Var Parameter}] - ["[0]" box] - ["[0]" descriptor] - ["[0]" reflection]]]] - [tool - [compiler - [phase {"+" Operation}]]]]] - ["[0]" // {"+" Inst}]) + [library + [lux {"-" Type Primitive int char try} + ["[0]" ffi {"+" import: do_to}] + [abstract + [monad {"+" do}]] + [control + ["[0]" function] + ["[0]" maybe] + ["[0]" try] + ["p" parser + ["s" code]]] + [data + ["[0]" product] + [collection + ["[0]" list ("[1]@[0]" functor)]]] + [macro + [syntax {"+" syntax:}] + ["[0]" code] + ["[0]" template]] + [math + [number + ["n" nat] + ["i" int]]] + [target + [jvm + [encoding + ["[0]" name {"+" External}]] + ["[0]" type {"+" Type} ("[1]@[0]" equivalence) + [category {"+" Void Value Return Method Primitive Object Class Array Var Parameter}] + ["[0]" box] + ["[0]" descriptor] + ["[0]" reflection]]]] + [tool + [compiler + [phase {"+" Operation}]]]]] + ["[0]" // {"+" Inst}]) (def: class_name (|>> type.descriptor descriptor.class_name name.read)) (def: descriptor (|>> type.descriptor descriptor.descriptor)) (def: reflection (|>> type.reflection reflection.reflection)) ... [Host] -(import: java/lang/Object) -(import: java/lang/String) +(import: java/lang/Object + "[1]::[0]") + +(import: java/lang/String + "[1]::[0]") (syntax: (declare [codes (p.many s.local_symbol)]) (|> codes @@ -50,103 +53,103 @@ in)) (`` (import: org/objectweb/asm/Opcodes - ["[1]::[0]" - ("static" NOP int) - - ... Conversion - (~~ (declare D2F D2I D2L - F2D F2I F2L - I2B I2C I2D I2F I2L I2S - L2D L2F L2I)) - - ... Primitive - (~~ (declare T_BOOLEAN T_CHAR T_FLOAT T_DOUBLE - T_BYTE T_SHORT T_INT T_LONG)) - - ... Class - (~~ (declare CHECKCAST NEW INSTANCEOF)) - - ... Stack - (~~ (declare DUP DUP_X1 DUP_X2 - DUP2 DUP2_X1 DUP2_X2 - POP POP2 - SWAP)) - - ... Jump - (~~ (declare IF_ICMPEQ IF_ICMPGT IF_ICMPLT - IF_ICMPNE IF_ICMPGE IF_ICMPLE - IF_ACMPEQ IF_ACMPNE IFNULL IFNONNULL - IFEQ IFNE IFLT IFLE IFGT IFGE - GOTO)) - - (~~ (declare BIPUSH SIPUSH)) - (~~ (declare ICONST_M1 ICONST_0 ICONST_1 ICONST_2 ICONST_3 ICONST_4 ICONST_5 - LCONST_0 LCONST_1 - FCONST_0 FCONST_1 FCONST_2 - DCONST_0 DCONST_1)) - ("static" ACONST_NULL int) - - ... Var - (~~ (declare IINC - ILOAD LLOAD FLOAD DLOAD ALOAD - ISTORE LSTORE FSTORE DSTORE ASTORE)) - - ... Arithmetic - (~~ (declare IADD ISUB IMUL IDIV IREM INEG - LADD LSUB LMUL LDIV LREM LNEG LCMP - FADD FSUB FMUL FDIV FREM FNEG FCMPG FCMPL - DADD DSUB DMUL DDIV DREM DNEG DCMPG DCMPL)) - - ... Bit-wise - (~~ (declare IAND IOR IXOR ISHL ISHR IUSHR - LAND LOR LXOR LSHL LSHR LUSHR)) - - ... Array - (~~ (declare ARRAYLENGTH NEWARRAY ANEWARRAY - AALOAD AASTORE - BALOAD BASTORE - SALOAD SASTORE - IALOAD IASTORE - LALOAD LASTORE - FALOAD FASTORE - DALOAD DASTORE - CALOAD CASTORE)) - - ... Member - (~~ (declare GETSTATIC PUTSTATIC GETFIELD PUTFIELD - INVOKESTATIC INVOKESPECIAL INVOKEVIRTUAL INVOKEINTERFACE)) - - ("static" ATHROW int) - - ... Concurrency - (~~ (declare MONITORENTER MONITOREXIT)) - - ... Return - (~~ (declare RETURN IRETURN LRETURN FRETURN DRETURN ARETURN))] + "[1]::[0]" + ("static" NOP int) + + ... Conversion + (~~ (declare D2F D2I D2L + F2D F2I F2L + I2B I2C I2D I2F I2L I2S + L2D L2F L2I)) + + ... Primitive + (~~ (declare T_BOOLEAN T_CHAR T_FLOAT T_DOUBLE + T_BYTE T_SHORT T_INT T_LONG)) + + ... Class + (~~ (declare CHECKCAST NEW INSTANCEOF)) + + ... Stack + (~~ (declare DUP DUP_X1 DUP_X2 + DUP2 DUP2_X1 DUP2_X2 + POP POP2 + SWAP)) + + ... Jump + (~~ (declare IF_ICMPEQ IF_ICMPGT IF_ICMPLT + IF_ICMPNE IF_ICMPGE IF_ICMPLE + IF_ACMPEQ IF_ACMPNE IFNULL IFNONNULL + IFEQ IFNE IFLT IFLE IFGT IFGE + GOTO)) + + (~~ (declare BIPUSH SIPUSH)) + (~~ (declare ICONST_M1 ICONST_0 ICONST_1 ICONST_2 ICONST_3 ICONST_4 ICONST_5 + LCONST_0 LCONST_1 + FCONST_0 FCONST_1 FCONST_2 + DCONST_0 DCONST_1)) + ("static" ACONST_NULL int) + + ... Var + (~~ (declare IINC + ILOAD LLOAD FLOAD DLOAD ALOAD + ISTORE LSTORE FSTORE DSTORE ASTORE)) + + ... Arithmetic + (~~ (declare IADD ISUB IMUL IDIV IREM INEG + LADD LSUB LMUL LDIV LREM LNEG LCMP + FADD FSUB FMUL FDIV FREM FNEG FCMPG FCMPL + DADD DSUB DMUL DDIV DREM DNEG DCMPG DCMPL)) + + ... Bit-wise + (~~ (declare IAND IOR IXOR ISHL ISHR IUSHR + LAND LOR LXOR LSHL LSHR LUSHR)) + + ... Array + (~~ (declare ARRAYLENGTH NEWARRAY ANEWARRAY + AALOAD AASTORE + BALOAD BASTORE + SALOAD SASTORE + IALOAD IASTORE + LALOAD LASTORE + FALOAD FASTORE + DALOAD DASTORE + CALOAD CASTORE)) + + ... Member + (~~ (declare GETSTATIC PUTSTATIC GETFIELD PUTFIELD + INVOKESTATIC INVOKESPECIAL INVOKEVIRTUAL INVOKEINTERFACE)) + + ("static" ATHROW int) + + ... Concurrency + (~~ (declare MONITORENTER MONITOREXIT)) + + ... Return + (~~ (declare RETURN IRETURN LRETURN FRETURN DRETURN ARETURN)) )) (import: org/objectweb/asm/Label - ["[1]::[0]" - (new [])]) + "[1]::[0]" + (new [])) (import: org/objectweb/asm/MethodVisitor - ["[1]::[0]" - (visitCode [] void) - (visitMaxs [int int] void) - (visitEnd [] void) - (visitInsn [int] void) - (visitLdcInsn [java/lang/Object] void) - (visitFieldInsn [int java/lang/String java/lang/String java/lang/String] void) - (visitTypeInsn [int java/lang/String] void) - (visitVarInsn [int int] void) - (visitIntInsn [int int] void) - (visitMethodInsn [int java/lang/String java/lang/String java/lang/String boolean] void) - (visitLabel [org/objectweb/asm/Label] void) - (visitJumpInsn [int org/objectweb/asm/Label] void) - (visitTryCatchBlock [org/objectweb/asm/Label org/objectweb/asm/Label org/objectweb/asm/Label java/lang/String] void) - (visitLookupSwitchInsn [org/objectweb/asm/Label [int] [org/objectweb/asm/Label]] void) - (visitTableSwitchInsn [int int org/objectweb/asm/Label [org/objectweb/asm/Label]] void) - ]) + "[1]::[0]" + (visitCode [] void) + (visitMaxs [int int] void) + (visitEnd [] void) + (visitInsn [int] void) + (visitLdcInsn [java/lang/Object] void) + (visitFieldInsn [int java/lang/String java/lang/String java/lang/String] void) + (visitTypeInsn [int java/lang/String] void) + (visitVarInsn [int int] void) + (visitIntInsn [int int] void) + (visitMethodInsn [int java/lang/String java/lang/String java/lang/String boolean] void) + (visitLabel [org/objectweb/asm/Label] void) + (visitJumpInsn [int org/objectweb/asm/Label] void) + (visitTryCatchBlock [org/objectweb/asm/Label org/objectweb/asm/Label org/objectweb/asm/Label java/lang/String] void) + (visitLookupSwitchInsn [org/objectweb/asm/Label [int] [org/objectweb/asm/Label]] void) + (visitTableSwitchInsn [int int org/objectweb/asm/Label [org/objectweb/asm/Label]] void) + ) ... [Insts] (def: .public make_label diff --git a/lux-jvm/source/luxc/lang/translation/jvm.lux b/lux-jvm/source/luxc/lang/translation/jvm.lux index e2bd46f5d..e65d58052 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm.lux @@ -42,18 +42,19 @@ ) (import: java/lang/reflect/Field - ["[1]::[0]" - (get ["?" java/lang/Object] "try" "?" java/lang/Object)]) + "[1]::[0]" + (get ["?" java/lang/Object] "try" "?" java/lang/Object)) (import: (java/lang/Class a) - ["[1]::[0]" - (getField [java/lang/String] "try" java/lang/reflect/Field)]) + "[1]::[0]" + (getField [java/lang/String] "try" java/lang/reflect/Field)) (import: java/lang/Object - ["[1]::[0]" - (getClass [] (java/lang/Class java/lang/Object))]) + "[1]::[0]" + (getClass [] (java/lang/Class java/lang/Object))) -(import: java/lang/ClassLoader) +(import: java/lang/ClassLoader + "[1]::[0]") (type: .public ByteCode Binary) diff --git a/lux-jvm/source/luxc/lang/translation/jvm/primitive.lux b/lux-jvm/source/luxc/lang/translation/jvm/primitive.lux index 0f2b64f9f..016639f2e 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/primitive.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/primitive.lux @@ -1,21 +1,21 @@ (.using - [library - [lux {"-" i64} - ["[0]" ffi {"+" import:}] - [math - [number - ["i" int]]] - [target - [jvm - ["[0]" type]]] - [tool - [compiler - [phase ("operation@[0]" monad)]]]]] - [luxc - [lang - [host - ["[0]" jvm {"+" Inst Operation} - ["_" inst]]]]]) + [library + [lux {"-" i64} + ["[0]" ffi {"+" import:}] + [math + [number + ["i" int]]] + [target + [jvm + ["[0]" type]]] + [tool + [compiler + [phase ("operation@[0]" monad)]]]]] + [luxc + [lang + [host + ["[0]" jvm {"+" Inst Operation} + ["_" inst]]]]]) (def: .public bit (-> Bit (Operation Inst)) @@ -24,14 +24,14 @@ (operation@in (_.GETSTATIC Boolean (if value "TRUE" "FALSE") Boolean))))) (import: java/lang/Byte - ["[1]::[0]" - ("static" MAX_VALUE byte) - ("static" MIN_VALUE byte)]) + "[1]::[0]" + ("static" MAX_VALUE byte) + ("static" MIN_VALUE byte)) (import: java/lang/Short - ["[1]::[0]" - ("static" MAX_VALUE short) - ("static" MIN_VALUE short)]) + "[1]::[0]" + ("static" MAX_VALUE short) + ("static" MIN_VALUE short)) (def: .public (i64 value) (-> (I64 Any) (Operation Inst)) @@ -67,8 +67,8 @@ (operation@in (|>> constantI (_.wrap type.long)))))) (import: java/lang/Double - ["[1]::[0]" - ("static" doubleToRawLongBits "manual" [double] int)]) + "[1]::[0]" + ("static" doubleToRawLongBits "manual" [double] int)) (def: d0-bits Int diff --git a/lux-jvm/source/luxc/lang/translation/jvm/structure.lux b/lux-jvm/source/luxc/lang/translation/jvm/structure.lux index 9c8b8b52a..e7604be15 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/structure.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/structure.lux @@ -1,41 +1,41 @@ (.using - [library - [lux {"-" Type Primitive} - ["[0]" ffi {"+" import:}] - [abstract - ["[0]" monad {"+" do}]] - [control - ["[0]" exception {"+" exception:}]] - [data - [text - ["%" format {"+" format}]] - [collection - ["[0]" list]]] - [math - [number - ["n" nat] - ["i" int]]] - [target - [jvm - ["[0]" type {"+" Type} - ["[0]" category {"+" Void Value Return Primitive Object Class Array Var Parameter Method}] - ["[0]" descriptor {"+" Descriptor}] - ["[0]" signature {"+" Signature}]]]] - [tool - [compiler - ["[0]" phase] - [meta - [archive {"+" Archive}]] - [language - [lux - [synthesis {"+" Synthesis}]]]]]]] - [luxc - [lang - [host - [jvm {"+" Inst Operation Phase Generator} - ["_" inst]]]]] - ["[0]" // - ["[1][0]" runtime]]) + [library + [lux {"-" Type Primitive} + ["[0]" ffi {"+" import:}] + [abstract + ["[0]" monad {"+" do}]] + [control + ["[0]" exception {"+" exception:}]] + [data + [text + ["%" format {"+" format}]] + [collection + ["[0]" list]]] + [math + [number + ["n" nat] + ["i" int]]] + [target + [jvm + ["[0]" type {"+" Type} + ["[0]" category {"+" Void Value Return Primitive Object Class Array Var Parameter Method}] + ["[0]" descriptor {"+" Descriptor}] + ["[0]" signature {"+" Signature}]]]] + [tool + [compiler + ["[0]" phase] + [meta + [archive {"+" Archive}]] + [language + [lux + [synthesis {"+" Synthesis}]]]]]]] + [luxc + [lang + [host + [jvm {"+" Inst Operation Phase Generator} + ["_" inst]]]]] + ["[0]" // + ["[1][0]" runtime]]) (exception: .public (not_a_tuple [size Nat]) (exception.report @@ -63,14 +63,14 @@ membersI)))) (import: java/lang/Byte - ["[1]::[0]" - ("static" MAX_VALUE byte) - ("static" MIN_VALUE byte)]) + "[1]::[0]" + ("static" MAX_VALUE byte) + ("static" MIN_VALUE byte)) (import: java/lang/Short - ["[1]::[0]" - ("static" MAX_VALUE short) - ("static" MIN_VALUE short)]) + "[1]::[0]" + ("static" MAX_VALUE short) + ("static" MIN_VALUE short)) (def: .public (tagI lefts right?) (-> Nat Bit Inst) diff --git a/lux-lua/source/program.lux b/lux-lua/source/program.lux index 631b55d9a..56437b026 100644 --- a/lux-lua/source/program.lux +++ b/lux-lua/source/program.lux @@ -67,92 +67,104 @@ [program ["/" compositor]]) -(with_expansions [<jvm> (as_is (ffi.import: java/lang/String) +(with_expansions [<jvm> (as_is (ffi.import: java/lang/String + "[1]::[0]") - (ffi.import: (java/lang/Class a)) + (ffi.import: (java/lang/Class a) + "[1]::[0]") (ffi.import: java/lang/Object - ["[1]::[0]" - (toString [] java/lang/String) - (getClass [] (java/lang/Class java/lang/Object))]) + "[1]::[0]" + (toString [] java/lang/String) + (getClass [] (java/lang/Class java/lang/Object))) - (ffi.import: java/lang/Integer) + (ffi.import: java/lang/Integer + "[1]::[0]") (ffi.import: java/lang/Long - ["[1]::[0]" - (intValue [] int)]) + "[1]::[0]" + (intValue [] int)) - (ffi.import: net/sandius/rembulan/StateContext) + (ffi.import: net/sandius/rembulan/StateContext + "[1]::[0]") (ffi.import: net/sandius/rembulan/impl/StateContexts - ["[1]::[0]" - ("static" newDefaultInstance [] net/sandius/rembulan/StateContext)]) + "[1]::[0]" + ("static" newDefaultInstance [] net/sandius/rembulan/StateContext)) - (ffi.import: net/sandius/rembulan/env/RuntimeEnvironment) + (ffi.import: net/sandius/rembulan/env/RuntimeEnvironment + "[1]::[0]") (ffi.import: net/sandius/rembulan/env/RuntimeEnvironments - ["[1]::[0]" - ("static" system [] net/sandius/rembulan/env/RuntimeEnvironment)]) + "[1]::[0]" + ("static" system [] net/sandius/rembulan/env/RuntimeEnvironment)) (ffi.import: net/sandius/rembulan/Table - ["[1]::[0]" - (rawget "as" get_idx [long] "?" java/lang/Object) - (rawget "as" get_key [java/lang/Object] "?" java/lang/Object) - (rawlen [] long)]) + "[1]::[0]" + (rawget "as" get_idx [long] "?" java/lang/Object) + (rawget "as" get_key [java/lang/Object] "?" java/lang/Object) + (rawlen [] long)) (ffi.import: net/sandius/rembulan/ByteString - ["[1]::[0]" - (decode [] java/lang/String)]) + "[1]::[0]" + (decode [] java/lang/String)) - (ffi.import: net/sandius/rembulan/impl/DefaultTable) + (ffi.import: net/sandius/rembulan/impl/DefaultTable + "[1]::[0]") - (ffi.import: net/sandius/rembulan/impl/ImmutableTable) + (ffi.import: net/sandius/rembulan/impl/ImmutableTable + "[1]::[0]") (ffi.import: net/sandius/rembulan/impl/ImmutableTable$Builder - ["[1]::[0]" - (new []) - (build [] net/sandius/rembulan/impl/ImmutableTable)]) + "[1]::[0]" + (new []) + (build [] net/sandius/rembulan/impl/ImmutableTable)) (ffi.import: net/sandius/rembulan/lib/StandardLibrary - ["[1]::[0]" - ("static" in [net/sandius/rembulan/env/RuntimeEnvironment] net/sandius/rembulan/lib/StandardLibrary) - (installInto [net/sandius/rembulan/StateContext] net/sandius/rembulan/Table)]) + "[1]::[0]" + ("static" in [net/sandius/rembulan/env/RuntimeEnvironment] net/sandius/rembulan/lib/StandardLibrary) + (installInto [net/sandius/rembulan/StateContext] net/sandius/rembulan/Table)) (ffi.import: net/sandius/rembulan/Variable - ["[1]::[0]" - (new [java/lang/Object])]) + "[1]::[0]" + (new [java/lang/Object])) (ffi.import: net/sandius/rembulan/runtime/ReturnBuffer - ["[1]::[0]" - (setTo [java/lang/Object] void)]) + "[1]::[0]" + (setTo [java/lang/Object] void)) (ffi.import: net/sandius/rembulan/runtime/ExecutionContext - ["[1]::[0]" - (getReturnBuffer [] net/sandius/rembulan/runtime/ReturnBuffer)]) + "[1]::[0]" + (getReturnBuffer [] net/sandius/rembulan/runtime/ReturnBuffer)) - (ffi.import: net/sandius/rembulan/runtime/ResolvedControlThrowable) - (ffi.import: net/sandius/rembulan/runtime/LuaFunction) + (ffi.import: net/sandius/rembulan/runtime/ResolvedControlThrowable + "[1]::[0]") + + (ffi.import: net/sandius/rembulan/runtime/LuaFunction + "[1]::[0]") (ffi.import: net/sandius/rembulan/load/ChunkLoader - ["[1]::[0]" - (loadTextChunk [net/sandius/rembulan/Variable - java/lang/String - java/lang/String] - "try" net/sandius/rembulan/runtime/LuaFunction)]) + "[1]::[0]" + (loadTextChunk [net/sandius/rembulan/Variable + java/lang/String + java/lang/String] + "try" net/sandius/rembulan/runtime/LuaFunction)) (ffi.import: net/sandius/rembulan/compiler/CompilerChunkLoader - ["[1]::[0]" - ("static" of [java/lang/String] net/sandius/rembulan/compiler/CompilerChunkLoader)]) + "[1]::[0]" + ("static" of [java/lang/String] net/sandius/rembulan/compiler/CompilerChunkLoader)) - (ffi.import: net/sandius/rembulan/runtime/SchedulingContext) + (ffi.import: net/sandius/rembulan/runtime/SchedulingContext + "[1]::[0]") - (ffi.import: net/sandius/rembulan/runtime/SchedulingContextFactory) + (ffi.import: net/sandius/rembulan/runtime/SchedulingContextFactory + "[1]::[0]") (ffi.import: net/sandius/rembulan/exec/DirectCallExecutor - ["[1]::[0]" - ("static" newExecutor [] net/sandius/rembulan/exec/DirectCallExecutor) - (schedulingContextFactory [] net/sandius/rembulan/runtime/SchedulingContextFactory) - (call [net/sandius/rembulan/StateContext java/lang/Object [java/lang/Object]] "try" [java/lang/Object])]) + "[1]::[0]" + ("static" newExecutor [] net/sandius/rembulan/exec/DirectCallExecutor) + (schedulingContextFactory [] net/sandius/rembulan/runtime/SchedulingContextFactory) + (call [net/sandius/rembulan/StateContext java/lang/Object [java/lang/Object]] "try" [java/lang/Object])) (exception: (unknown_kind_of_object [object java/lang/Object]) (exception.report @@ -163,8 +175,8 @@ (getValue [] java/lang/Object)) (ffi.import: LuxValue - ["[1]::[0]" - (getValue [] java/lang/Object)]) + "[1]::[0]" + (getValue [] java/lang/Object)) (type: Translator (-> java/lang/Object (Try Any))) @@ -354,7 +366,8 @@ lux_function))) ))))) - (ffi.import: library/lux/Function) + (ffi.import: library/lux/Function + "[1]::[0]") (def: (lux_structure to_host value) (-> (-> Any java/lang/Object) (Array java/lang/Object) LuxValue) diff --git a/lux-php/source/program.lux b/lux-php/source/program.lux index 383e89e5d..6436b2177 100644 --- a/lux-php/source/program.lux +++ b/lux-php/source/program.lux @@ -64,110 +64,115 @@ ["[1][0]" cli] ["[1][0]" static]]]) -(ffi.import: java/lang/String) +(ffi.import: java/lang/String + "[1]::[0]") (ffi.import: java/lang/reflect/Field - ["[1]::[0]" - (get [java/lang/Object] java/lang/Object)]) + "[1]::[0]" + (get [java/lang/Object] java/lang/Object)) (ffi.import: java/lang/reflect/AccessibleObject - ["[1]::[0]" - (setAccessible [boolean] void)]) + "[1]::[0]" + (setAccessible [boolean] void)) (ffi.import: (java/lang/Class a) - ["[1]::[0]" - (getDeclaredField [java/lang/String] java/lang/reflect/Field)]) + "[1]::[0]" + (getDeclaredField [java/lang/String] java/lang/reflect/Field)) (ffi.import: java/lang/Object - ["[1]::[0]" - (toString [] java/lang/String) - (getClass [] (java/lang/Class java/lang/Object))]) + "[1]::[0]" + (toString [] java/lang/String) + (getClass [] (java/lang/Class java/lang/Object))) -(ffi.import: java/lang/Integer) +(ffi.import: java/lang/Integer + "[1]::[0]") (ffi.import: java/lang/Long - ["[1]::[0]" - (intValue [] java/lang/Integer)]) + "[1]::[0]" + (intValue [] java/lang/Integer)) (ffi.import: php/runtime/Memory - ["[1]::[0]" - (valueOfIndex "as" generic_valueOfIndex [php/runtime/env/TraceInfo php/runtime/Memory] php/runtime/Memory) - (valueOfIndex "as" long_valueOfIndex [php/runtime/env/TraceInfo long] php/runtime/Memory) - (valueOfIndex "as" string_valueOfIndex [php/runtime/env/TraceInfo java/lang/String] php/runtime/Memory)]) + "[1]::[0]" + (valueOfIndex "as" generic_valueOfIndex [php/runtime/env/TraceInfo php/runtime/Memory] php/runtime/Memory) + (valueOfIndex "as" long_valueOfIndex [php/runtime/env/TraceInfo long] php/runtime/Memory) + (valueOfIndex "as" string_valueOfIndex [php/runtime/env/TraceInfo java/lang/String] php/runtime/Memory)) (ffi.import: php/runtime/Memory$Type - ["[1]::[0]" - ("enum" ARRAY)]) + "[1]::[0]" + ("enum" ARRAY)) (ffi.import: php/runtime/memory/NullMemory - ["[1]::[0]" - ("static" INSTANCE php/runtime/memory/NullMemory)]) + "[1]::[0]" + ("static" INSTANCE php/runtime/memory/NullMemory)) (ffi.import: php/runtime/memory/FalseMemory - ["[1]::[0]" - ("static" INSTANCE php/runtime/memory/FalseMemory)]) + "[1]::[0]" + ("static" INSTANCE php/runtime/memory/FalseMemory)) (ffi.import: php/runtime/memory/TrueMemory - ["[1]::[0]" - ("static" INSTANCE php/runtime/memory/TrueMemory)]) + "[1]::[0]" + ("static" INSTANCE php/runtime/memory/TrueMemory)) (ffi.import: php/runtime/memory/LongMemory - ["[1]::[0]" - (new [long]) - (toLong [] long) - ("static" valueOf "manual" [int] php/runtime/Memory)]) + "[1]::[0]" + (new [long]) + (toLong [] long) + ("static" valueOf "manual" [int] php/runtime/Memory)) (ffi.import: php/runtime/memory/DoubleMemory - ["[1]::[0]" - (new [double]) - (toDouble [] double)]) + "[1]::[0]" + (new [double]) + (toDouble [] double)) (ffi.import: php/runtime/memory/StringMemory - ["[1]::[0]" - (new [java/lang/String]) - (toString [] java/lang/String)]) + "[1]::[0]" + (new [java/lang/String]) + (toString [] java/lang/String)) (ffi.import: php/runtime/memory/ReferenceMemory - ["[1]::[0]" - (getValue [] php/runtime/Memory)]) + "[1]::[0]" + (getValue [] php/runtime/Memory)) (ffi.import: php/runtime/memory/ArrayMemory - ["[1]::[0]" - (new [[java/lang/Object]]) - (size [] int) - (isMap [] boolean) - (get [php/runtime/Memory] "?" php/runtime/Memory)]) + "[1]::[0]" + (new [[java/lang/Object]]) + (size [] int) + (isMap [] boolean) + (get [php/runtime/Memory] "?" php/runtime/Memory)) -(ffi.import: php/runtime/lang/IObject) +(ffi.import: php/runtime/lang/IObject + "[1]::[0]") (ffi.import: php/runtime/memory/ObjectMemory - ["[1]::[0]" - (value php/runtime/lang/IObject)]) + "[1]::[0]" + (value php/runtime/lang/IObject)) -(ffi.import: php/runtime/env/Environment) +(ffi.import: php/runtime/env/Environment + "[1]::[0]") (ffi.import: php/runtime/env/TraceInfo - ["[1]::[0]" - (new [java/lang/String int int])]) + "[1]::[0]" + (new [java/lang/String int int])) -(ffi.import: php/runtime/reflection/FunctionEntity) +(ffi.import: php/runtime/reflection/FunctionEntity + "[1]::[0]") (ffi.import: php/runtime/invoke/InvokeHelper - ["[1]::[0]" - ("static" callAny [php/runtime/Memory [php/runtime/Memory] php/runtime/env/Environment php/runtime/env/TraceInfo] - "try" php/runtime/Memory)]) + "[1]::[0]" + ("static" callAny [php/runtime/Memory [php/runtime/Memory] php/runtime/env/Environment php/runtime/env/TraceInfo] + "try" php/runtime/Memory)) (ffi.import: php/runtime/lang/Closure - ["[1]::[0]" - (call [php/runtime/env/Environment [php/runtime/Memory]] "try" php/runtime/Memory)]) + "[1]::[0]" + (call [php/runtime/env/Environment [php/runtime/Memory]] "try" php/runtime/Memory)) (template [<name>] [(ffi.interface: <name> (getValue [] java/lang/Object)) (`` (ffi.import: (~~ (template.symbol ["program/" <name>])) - ["[1]::[0]" - (getValue [] java/lang/Object)]))] + "[1]::[0]" + (getValue [] java/lang/Object)))] [StructureValue] ) @@ -416,12 +421,12 @@ ["Non-function" (java/lang/Object::toString object)])) (ffi.import: javax/script/ScriptEngine - ["[1]::[0]" - (eval [java/lang/String] "try" Object)]) + "[1]::[0]" + (eval [java/lang/String] "try" Object)) (ffi.import: org/develnext/jphp/scripting/JPHPScriptEngine - ["[1]::[0]" - (new [])]) + "[1]::[0]" + (new [])) (def: (ensure_macro macro) (-> Macro (Maybe php/runtime/memory/ObjectMemory)) diff --git a/lux-python/source/program.lux b/lux-python/source/program.lux index e784a834e..d2b3c65af 100644 --- a/lux-python/source/program.lux +++ b/lux-python/source/program.lux @@ -71,67 +71,76 @@ [program ["/" compositor]]) -(with_expansions [<jvm> (as_is (import: java/lang/String) +(with_expansions [<jvm> (as_is (import: java/lang/String + "[1]::[0]") (import: (java/lang/Class a) - ["[1]::[0]" - ("static" forName [java/lang/String] (java/lang/Class java/lang/Object)) - (getName [] java/lang/String)]) + "[1]::[0]" + ("static" forName [java/lang/String] (java/lang/Class java/lang/Object)) + (getName [] java/lang/String)) (import: java/lang/Object - ["[1]::[0]" - (new []) - (toString [] java/lang/String) - (getClass [] (java/lang/Class java/lang/Object))]) - - (import: org/python/core/PyNone) - (import: org/python/core/PyInteger) - (import: org/python/core/PyTuple) - (import: org/python/core/PyList) + "[1]::[0]" + (new []) + (toString [] java/lang/String) + (getClass [] (java/lang/Class java/lang/Object))) + + (import: org/python/core/PyNone + "[1]::[0]") + + (import: org/python/core/PyInteger + "[1]::[0]") + + (import: org/python/core/PyTuple + "[1]::[0]") + + (import: org/python/core/PyList + "[1]::[0]") (import: org/python/core/PyBoolean - ["[1]::[0]" - (new [boolean])]) + "[1]::[0]" + (new [boolean])) (import: org/python/core/PyLong - ["[1]::[0]" - (new [long])]) + "[1]::[0]" + (new [long])) (import: org/python/core/PyFloat - ["[1]::[0]" - (new [double])]) + "[1]::[0]" + (new [double])) (import: org/python/core/PyString - ["[1]::[0]" - (new [java/lang/String])]) + "[1]::[0]" + (new [java/lang/String])) (import: org/python/core/PyObject - ["[1]::[0]" - (asInt [] java/lang/Integer) - (asLong [] long) - (asDouble [] double) - (asString [] java/lang/String) - (__nonzero__ [] boolean) - (__getitem__ [int] "try" org/python/core/PyObject) - (__getitem__ "as" __getitem__dict [org/python/core/PyObject] "try" org/python/core/PyObject) - (__len__ [] int)]) + "[1]::[0]" + (asInt [] java/lang/Integer) + (asLong [] long) + (asDouble [] double) + (asString [] java/lang/String) + (__nonzero__ [] boolean) + (__getitem__ [int] "try" org/python/core/PyObject) + (__getitem__ "as" __getitem__dict [org/python/core/PyObject] "try" org/python/core/PyObject) + (__len__ [] int)) (import: org/python/core/PyFunction - ["[1]::[0]" - (__call__ [[org/python/core/PyObject]] "try" org/python/core/PyObject)]) + "[1]::[0]" + (__call__ [[org/python/core/PyObject]] "try" org/python/core/PyObject)) - (import: org/python/core/ThreadState) + (import: org/python/core/ThreadState + "[1]::[0]") (import: org/python/core/PyArray - ["[1]::[0]" - (new [(java/lang/Class [? < java/lang/Object]) java/lang/Object]) - (getArray [] java/lang/Object)]) + "[1]::[0]" + (new [(java/lang/Class [? < java/lang/Object]) java/lang/Object]) + (getArray [] java/lang/Object)) (import: org/python/util/PythonInterpreter - ["[1]::[0]" - (new []) - (exec [java/lang/String] "try" void) - (eval [java/lang/String] "try" PyObject)]) + "[1]::[0]" + (new []) + (exec [java/lang/String] "try" void) + (eval [java/lang/String] "try" PyObject)) (type: Translator (-> org/python/core/PyObject (Try Any))) @@ -193,8 +202,8 @@ (value [] java/lang/Object)) (import: LuxValue - ["[1]::[0]" - (value [] java/lang/Object)]) + "[1]::[0]" + (value [] java/lang/Object)) (def: (read host_object) Translator @@ -287,7 +296,8 @@ (java/lang/Class java/lang/Object) (java/lang/Object::getClass (java/lang/Object::new))) - (import: library/lux/Function) + (import: library/lux/Function + "[1]::[0]") (def: (to_host|array to_host it) (-> (-> Any org/python/core/PyObject) Any org/python/core/PyObject) diff --git a/lux-r/source/program.lux b/lux-r/source/program.lux index 570a52b4e..2ba9794ad 100644 --- a/lux-r/source/program.lux +++ b/lux-r/source/program.lux @@ -68,100 +68,108 @@ ["[1][0]" cli] ["[1][0]" static]]]) -(ffi.import: java/lang/String) +(ffi.import: java/lang/String + "[1]::[0]") (ffi.import: (java/lang/Class a) - ["[1]::[0]" - ("static" forName [java/lang/String] "try" (java/lang/Class java/lang/Object))]) + "[1]::[0]" + ("static" forName [java/lang/String] "try" (java/lang/Class java/lang/Object))) (ffi.import: java/lang/Object - ["[1]::[0]" - (toString [] java/lang/String) - (getClass [] (java/lang/Class java/lang/Object))]) + "[1]::[0]" + (toString [] java/lang/String) + (getClass [] (java/lang/Class java/lang/Object))) (ffi.import: java/lang/Long - ["[1]::[0]" - (intValue [] java/lang/Integer)]) + "[1]::[0]" + (intValue [] java/lang/Integer)) (ffi.import: java/lang/Integer - ["[1]::[0]" - (longValue [] long)]) + "[1]::[0]" + (longValue [] long)) (ffi.import: java/lang/Number - ["[1]::[0]" - (intValue [] java/lang/Integer) - (longValue [] long) - (doubleValue [] double)]) + "[1]::[0]" + (intValue [] java/lang/Integer) + (longValue [] long) + (doubleValue [] double)) (ffi.import: org/renjin/sexp/SEXP - ["[1]::[0]" - (asInt [] int)]) + "[1]::[0]" + (asInt [] int)) (ffi.import: org/renjin/sexp/AttributeMap - ["[1]::[0]" - ("static" EMPTY org/renjin/sexp/AttributeMap)]) + "[1]::[0]" + ("static" EMPTY org/renjin/sexp/AttributeMap)) -(ffi.import: org/renjin/sexp/AbstractSEXP) +(ffi.import: org/renjin/sexp/AbstractSEXP + "[1]::[0]") -(ffi.import: org/renjin/sexp/IntArrayVector) +(ffi.import: org/renjin/sexp/IntArrayVector + "[1]::[0]") (ffi.import: org/renjin/sexp/Logical - ["[1]::[0]" - (toBooleanStrict [] boolean)]) + "[1]::[0]" + (toBooleanStrict [] boolean)) (ffi.import: org/renjin/sexp/LogicalVector - ["[1]::[0]" - (asLogical [] org/renjin/sexp/Logical)]) + "[1]::[0]" + (asLogical [] org/renjin/sexp/Logical)) (ffi.import: org/renjin/sexp/LogicalArrayVector) (ffi.import: org/renjin/sexp/StringVector - ["[1]::[0]" - (asString [] java/lang/String)]) + "[1]::[0]" + (asString [] java/lang/String)) -(ffi.import: org/renjin/sexp/StringArrayVector) +(ffi.import: org/renjin/sexp/StringArrayVector + "[1]::[0]") -(ffi.import: org/renjin/sexp/Null) +(ffi.import: org/renjin/sexp/Null + "[1]::[0]") (ffi.import: org/renjin/sexp/ListVector - ["[1]::[0]" - (get "as" get_index [int] org/renjin/sexp/SEXP) - (get "as" get_field [java/lang/String] org/renjin/sexp/SEXP) - (length [] int)]) + "[1]::[0]" + (get "as" get_index [int] org/renjin/sexp/SEXP) + (get "as" get_field [java/lang/String] org/renjin/sexp/SEXP) + (length [] int)) -(ffi.import: org/renjin/sexp/PairList) +(ffi.import: org/renjin/sexp/PairList + "[1]::[0]") (ffi.import: org/renjin/sexp/PairList$Builder - ["[1]::[0]" - (new []) - (add [org/renjin/sexp/SEXP] org/renjin/sexp/PairList$Builder) - (build [] org/renjin/sexp/PairList)]) + "[1]::[0]" + (new []) + (add [org/renjin/sexp/SEXP] org/renjin/sexp/PairList$Builder) + (build [] org/renjin/sexp/PairList)) -(ffi.import: org/renjin/eval/Context) +(ffi.import: org/renjin/eval/Context + "[1]::[0]") -(ffi.import: org/renjin/sexp/Environment) +(ffi.import: org/renjin/sexp/Environment + "[1]::[0]") (ffi.import: org/renjin/sexp/FunctionCall - ["[1]::[0]" - (new [org/renjin/sexp/SEXP org/renjin/sexp/PairList]) - (eval [org/renjin/eval/Context org/renjin/sexp/Environment] "try" org/renjin/sexp/SEXP)]) + "[1]::[0]" + (new [org/renjin/sexp/SEXP org/renjin/sexp/PairList]) + (eval [org/renjin/eval/Context org/renjin/sexp/Environment] "try" org/renjin/sexp/SEXP)) (ffi.import: org/renjin/sexp/Closure - ["[1]::[0]" - (getEnclosingEnvironment [] org/renjin/sexp/Environment)]) + "[1]::[0]" + (getEnclosingEnvironment [] org/renjin/sexp/Environment)) (ffi.import: javax/script/ScriptEngine - ["[1]::[0]" - (eval [java/lang/String] "try" java/lang/Object)]) + "[1]::[0]" + (eval [java/lang/String] "try" java/lang/Object)) (ffi.import: org/renjin/script/RenjinScriptEngine - ["[1]::[0]" - (getRuntimeContext [] org/renjin/eval/Context)]) + "[1]::[0]" + (getRuntimeContext [] org/renjin/eval/Context)) (ffi.import: org/renjin/script/RenjinScriptEngineFactory - ["[1]::[0]" - (new []) - (getScriptEngine [] org/renjin/script/RenjinScriptEngine)]) + "[1]::[0]" + (new []) + (getScriptEngine [] org/renjin/script/RenjinScriptEngine)) (template [<name>] [(exception: (<name> [object java/lang/Object]) diff --git a/lux-ruby/source/program.lux b/lux-ruby/source/program.lux index 30a276d58..1d47453aa 100644 --- a/lux-ruby/source/program.lux +++ b/lux-ruby/source/program.lux @@ -73,74 +73,85 @@ [program ["/" compositor]]) -(import: java/lang/String) +(import: java/lang/String + "[1]::[0]") (import: (java/lang/Class a) - ["[1]::[0]" - (getSuperclass [] (java/lang/Class ?)) - (isInstance [java/lang/Object] boolean)]) + "[1]::[0]" + (getSuperclass [] (java/lang/Class ?)) + (isInstance [java/lang/Object] boolean)) (import: java/lang/Object - ["[1]::[0]" - (toString [] java/lang/String) - (getClass [] (java/lang/Class java/lang/Object))]) + "[1]::[0]" + (toString [] java/lang/String) + (getClass [] (java/lang/Class java/lang/Object))) (import: java/lang/Integer - ["[1]::[0]" - (longValue [] long)]) + "[1]::[0]" + (longValue [] long)) (import: java/lang/Long - ["[1]::[0]" - (intValue [] int)]) + "[1]::[0]" + (intValue [] int)) (import: org/jruby/RubyString - ["[1]::[0]" - ("static" newInternalFromJavaExternal [org/jruby/Ruby java/lang/String] org/jruby/RubyString) - (asJavaString [] java/lang/String)]) + "[1]::[0]" + ("static" newInternalFromJavaExternal [org/jruby/Ruby java/lang/String] org/jruby/RubyString) + (asJavaString [] java/lang/String)) (import: org/jruby/RubySymbol - ["[1]::[0]" - (asJavaString [] java/lang/String)]) + "[1]::[0]" + (asJavaString [] java/lang/String)) -(import: org/jruby/runtime/builtin/IRubyObject) +(import: org/jruby/runtime/builtin/IRubyObject + "[1]::[0]") (import: org/jruby/Ruby - ["[1]::[0]" - (getCurrentContext [] org/jruby/runtime/ThreadContext) - (getNil [] org/jruby/runtime/builtin/IRubyObject)]) + "[1]::[0]" + (getCurrentContext [] org/jruby/runtime/ThreadContext) + (getNil [] org/jruby/runtime/builtin/IRubyObject)) -(import: org/jruby/RubyClass) +(import: org/jruby/RubyClass + "[1]::[0]") (import: org/jruby/RubyArray - ["[1]::[0]" - (getLength [] int) - (get [int] "?" Object)]) + "[1]::[0]" + (getLength [] int) + (get [int] "?" Object)) (import: org/jruby/RubyHash - ["[1]::[0]" - (get [java/lang/Object] "?" java/lang/Object)]) + "[1]::[0]" + (get [java/lang/Object] "?" java/lang/Object)) -(import: org/jruby/runtime/ThreadContext) +(import: org/jruby/runtime/ThreadContext + "[1]::[0]") (import: org/jruby/RubyRange - ["[1]::[0]" - (first [org/jruby/runtime/ThreadContext] org/jruby/runtime/builtin/IRubyObject) - (size [org/jruby/runtime/ThreadContext] org/jruby/runtime/builtin/IRubyObject)]) + "[1]::[0]" + (first [org/jruby/runtime/ThreadContext] org/jruby/runtime/builtin/IRubyObject) + (size [org/jruby/runtime/ThreadContext] org/jruby/runtime/builtin/IRubyObject)) -(import: org/jruby/runtime/JavaSites$CheckedSites) -(import: org/jruby/runtime/builtin/Variable) -(import: org/jruby/runtime/builtin/InstanceVariables) -(import: org/jruby/runtime/builtin/InternalVariables) +(import: org/jruby/runtime/JavaSites$CheckedSites + "[1]::[0]") + +(import: org/jruby/runtime/builtin/Variable + "[1]::[0]") + +(import: org/jruby/runtime/builtin/InstanceVariables + "[1]::[0]") + +(import: org/jruby/runtime/builtin/InternalVariables + "[1]::[0]") (import: org/jruby/embed/internal/LocalContextProvider - ["[1]::[0]" - (getRuntime [] org/jruby/Ruby)]) + "[1]::[0]" + (getRuntime [] org/jruby/Ruby)) (import: org/jruby/embed/ScriptingContainer - ["[1]::[0]" - (new []) - (runScriptlet [java/lang/String] "try" "?" java/lang/Object) - (getProvider [] org/jruby/embed/internal/LocalContextProvider)]) + "[1]::[0]" + (new []) + (runScriptlet [java/lang/String] "try" "?" java/lang/Object) + (getProvider [] org/jruby/embed/internal/LocalContextProvider)) ... TODO; Figure out a way to not need "interpreter" to be a global variable. (def: interpreter @@ -159,61 +170,64 @@ (!ruby_runtime)) (import: org/jruby/java/proxies/JavaProxy - ["[1]::[0]" - (new [org/jruby/Ruby org/jruby/RubyClass java/lang/Object]) - (getObject [] java/lang/Object)]) + "[1]::[0]" + (new [org/jruby/Ruby org/jruby/RubyClass java/lang/Object]) + (getObject [] java/lang/Object)) -(import: org/jruby/internal/runtime/methods/DynamicMethod) +(import: org/jruby/internal/runtime/methods/DynamicMethod + "[1]::[0]") (import: org/jruby/runtime/callsite/CacheEntry - ["[1]::[0]" - (new [org/jruby/internal/runtime/methods/DynamicMethod int])]) + "[1]::[0]" + (new [org/jruby/internal/runtime/methods/DynamicMethod int])) (import: org/jruby/RubyFixnum - ["[1]::[0]" - (new [org/jruby/Ruby long]) - (getLongValue [] long)]) + "[1]::[0]" + (new [org/jruby/Ruby long]) + (getLongValue [] long)) (import: org/jruby/RubyFloat - ["[1]::[0]" - (new [org/jruby/Ruby double])]) + "[1]::[0]" + (new [org/jruby/Ruby double])) (import: org/jruby/RubyBoolean - ["[1]::[0]" - ("static" newBoolean [org/jruby/Ruby boolean] org/jruby/RubyBoolean)]) + "[1]::[0]" + ("static" newBoolean [org/jruby/Ruby boolean] org/jruby/RubyBoolean)) (import: org/jruby/RubyNil - ["[1]::[0]" - (new [org/jruby/Ruby])]) + "[1]::[0]" + (new [org/jruby/Ruby])) (import: org/jruby/runtime/Block$Type - ["[1]::[0]" - ("enum" PROC)]) + "[1]::[0]" + ("enum" PROC)) (import: org/jruby/runtime/Signature - ["[1]::[0]" - ("static" THREE_ARGUMENTS org/jruby/runtime/Signature)]) + "[1]::[0]" + ("static" THREE_ARGUMENTS org/jruby/runtime/Signature)) -(import: org/jruby/parser/StaticScope) +(import: org/jruby/parser/StaticScope + "[1]::[0]") (import: org/jruby/parser/StaticScopeFactory - ["[1]::[0]" - (new [org/jruby/Ruby]) - (getDummyScope [] org/jruby/parser/StaticScope)]) + "[1]::[0]" + (new [org/jruby/Ruby]) + (getDummyScope [] org/jruby/parser/StaticScope)) -(import: org/jruby/runtime/BlockBody) +(import: org/jruby/runtime/BlockBody + "[1]::[0]") (import: org/jruby/runtime/Block - ["[1]::[0]" - ("static" NULL_BLOCK org/jruby/runtime/Block) - (type org/jruby/runtime/Block$Type) - (getBody [] org/jruby/runtime/BlockBody)]) + "[1]::[0]" + ("static" NULL_BLOCK org/jruby/runtime/Block) + (type org/jruby/runtime/Block$Type) + (getBody [] org/jruby/runtime/BlockBody)) (import: org/jruby/RubyProc - ["[1]::[0]" - ("static" newProc [org/jruby/Ruby org/jruby/runtime/Block org/jruby/runtime/Block$Type] org/jruby/RubyProc) - (call [org/jruby/runtime/ThreadContext [org/jruby/runtime/builtin/IRubyObject]] - "try" org/jruby/runtime/builtin/IRubyObject)]) + "[1]::[0]" + ("static" newProc [org/jruby/Ruby org/jruby/runtime/Block org/jruby/runtime/Block$Type] org/jruby/RubyProc) + (call [org/jruby/runtime/ThreadContext [org/jruby/runtime/builtin/IRubyObject]] + "try" org/jruby/runtime/builtin/IRubyObject)) (type: Translator (-> java/lang/Object (Try Any))) @@ -350,8 +364,8 @@ ffi.of_string)])) (import: java/util/Arrays - ["[1]::[0]" - ("static" [t] copyOfRange [[t] int int] [t])]) + "[1]::[0]" + ("static" [t] copyOfRange [[t] int int] [t])) (exception: (invalid_arity [arity Nat]) (exception.report diff --git a/lux-scheme/source/program.lux b/lux-scheme/source/program.lux index e04ba5ac2..05714c13a 100644 --- a/lux-scheme/source/program.lux +++ b/lux-scheme/source/program.lux @@ -65,71 +65,77 @@ ["[1][0]" cli] ["[1][0]" static]]]) -(ffi.import: java/lang/Boolean) -(ffi.import: java/lang/String) +(ffi.import: java/lang/Boolean + "[1]::[0]") -(ffi.import: (java/lang/Class a)) +(ffi.import: java/lang/String + "[1]::[0]") + +(ffi.import: (java/lang/Class a) + "[1]::[0]") (ffi.import: java/lang/Object - ["[1]::[0]" - (toString [] java/lang/String) - (getClass [] (java/lang/Class java/lang/Object))]) + "[1]::[0]" + (toString [] java/lang/String) + (getClass [] (java/lang/Class java/lang/Object))) (ffi.import: java/lang/Long - ["[1]::[0]" - (intValue [] java/lang/Integer)]) + "[1]::[0]" + (intValue [] java/lang/Integer)) (ffi.import: java/lang/Integer - ["[1]::[0]" - (longValue [] java/lang/Long)]) + "[1]::[0]" + (longValue [] java/lang/Long)) (ffi.import: gnu/math/IntNum - ["[1]::[0]" - (new "manual" [int]) - (longValue [] long)]) + "[1]::[0]" + (new "manual" [int]) + (longValue [] long)) (ffi.import: gnu/math/DFloNum - ["[1]::[0]" - (doubleValue [] double)]) + "[1]::[0]" + (doubleValue [] double)) (ffi.import: gnu/lists/FString - ["[1]::[0]" - (toString [] String)]) + "[1]::[0]" + (toString [] String)) (ffi.import: gnu/lists/IString - ["[1]::[0]" - (toString [] String)]) + "[1]::[0]" + (toString [] String)) (ffi.import: gnu/lists/Pair - ["[1]::[0]" - (getCar [] java/lang/Object) - (getCdr [] java/lang/Object)]) + "[1]::[0]" + (getCar [] java/lang/Object) + (getCdr [] java/lang/Object)) (ffi.import: gnu/lists/EmptyList - ["[1]::[0]" - ("static" emptyList gnu/lists/EmptyList)]) + "[1]::[0]" + ("static" emptyList gnu/lists/EmptyList)) (ffi.import: (gnu/lists/FVector E) - ["[1]::[0]" - (getBufferLength [] int) - (getRaw [int] E)]) + "[1]::[0]" + (getBufferLength [] int) + (getRaw [int] E)) -(ffi.import: gnu/lists/U8Vector) +(ffi.import: gnu/lists/U8Vector + "[1]::[0]") (ffi.import: gnu/mapping/Procedure - ["[1]::[0]" - (apply2 [java/lang/Object java/lang/Object] "try" java/lang/Object) - (applyN [[java/lang/Object]] "try" java/lang/Object)]) + "[1]::[0]" + (apply2 [java/lang/Object java/lang/Object] "try" java/lang/Object) + (applyN [[java/lang/Object]] "try" java/lang/Object)) -(ffi.import: gnu/mapping/Environment) +(ffi.import: gnu/mapping/Environment + "[1]::[0]") (ffi.import: gnu/expr/Language - ["[1]::[0]" - (eval [java/lang/String] "try" java/lang/Object)]) + "[1]::[0]" + (eval [java/lang/String] "try" java/lang/Object)) (ffi.import: kawa/standard/Scheme - ["[1]::[0]" - ("static" getR7rsInstance [] kawa/standard/Scheme)]) + "[1]::[0]" + ("static" getR7rsInstance [] kawa/standard/Scheme)) (def: (variant? value) (-> Any Bit) @@ -158,8 +164,8 @@ (getValue [] java/lang/Object)) (`` (ffi.import: (~~ (template.symbol ["program/" <name>])) - ["[1]::[0]" - (getValue [] java/lang/Object)]))] + "[1]::[0]" + (getValue [] java/lang/Object)))] [VariantValue] [TupleValue] diff --git a/stdlib/source/documentation/lux/ffi.js.lux b/stdlib/source/documentation/lux/ffi.js.lux index 66b629d22..81082ada3 100644 --- a/stdlib/source/documentation/lux/ffi.js.lux +++ b/stdlib/source/documentation/lux/ffi.js.lux @@ -1,31 +1,32 @@ (.using - [library - [lux {"-" int char type :as} - ["$" documentation {"+" documentation:}] - [data - ["[0]" text {"+" \n} - ["%" format {"+" format}]]] - [macro - ["[0]" template]]]] - [\\library - ["[0]" /]]) + [library + [lux {"-" int char type :as} + ["$" documentation {"+" documentation:}] + [data + ["[0]" text {"+" \n} + ["%" format {"+" format}]]] + [macro + ["[0]" template]]]] + [\\library + ["[0]" /]]) (documentation: /.null "The null pointer.") (documentation: /.import: "Easily import types, methods, functions and constants." - [(import: Uint8Array) + [(import: Uint8Array + "[1]::[0]") (import: TextEncoder - ["[1]::[0]" - (new [/.String]) - (encode [/.String] Uint8Array)]) + "[1]::[0]" + (new [/.String]) + (encode [/.String] Uint8Array)) (import: TextDecoder - ["[1]::[0]" - (new [/.String]) - (decode [/.String] String)])]) + "[1]::[0]" + (new [/.String]) + (decode [/.String] String))]) (documentation: /.type_of "The type of an object, as text." diff --git a/stdlib/source/documentation/lux/ffi.jvm.lux b/stdlib/source/documentation/lux/ffi.jvm.lux index b3c628ffe..5bf182890 100644 --- a/stdlib/source/documentation/lux/ffi.jvm.lux +++ b/stdlib/source/documentation/lux/ffi.jvm.lux @@ -1,14 +1,14 @@ (.using - [library - [lux {"-" int char type :as} - ["$" documentation {"+" documentation:}] - [data - ["[0]" text {"+" \n} - ["%" format {"+" format}]]] - [macro - ["[0]" template]]]] - [\\library - ["[0]" /]]) + [library + [lux {"-" int char type :as} + ["$" documentation {"+" documentation:}] + [data + ["[0]" text {"+" \n} + ["%" format {"+" format}]]] + [macro + ["[0]" template]]]] + [\\library + ["[0]" /]]) (template [<name>] [(`` (documentation: <name> @@ -179,44 +179,44 @@ "Allows importing JVM classes, and using them as types." ["Their methods, fields and enum options can also be imported." (import: java/lang/Object - ["[1]::[0]" - (new []) - (equals [java/lang/Object] boolean) - (wait [int] "io" "try" void)])] + "[1]::[0]" + (new []) + (equals [java/lang/Object] boolean) + (wait [int] "io" "try" void))] ["Special options can also be given for the return values." "'?' means that the values will be returned inside a Maybe type. That way, null becomes .#None." "'try' means that the computation might throw an exception, and the return value will be wrapped by the Try type." "'io' means the computation has side effects, and will be wrapped by the IO type." "These options must show up in the following order ['io' 'try' '?'] (although, each option can be used independently)." (import: java/lang/String - ["[1]::[0]" - (new [[byte]]) - ("static" valueOf [char] java/lang/String) - ("static" valueOf "as" int_valueOf [int] java/lang/String)]) + "[1]::[0]" + (new [[byte]]) + ("static" valueOf [char] java/lang/String) + ("static" valueOf "as" int_valueOf [int] java/lang/String)) (import: (java/util/List e) - ["[1]::[0]" - (size [] int) - (get [int] e)]) + "[1]::[0]" + (size [] int) + (get [int] e)) (import: (java/util/ArrayList a) - ["[1]::[0]" - ([T] toArray [[T]] [T])])] + "[1]::[0]" + ([T] toArray [[T]] [T]))] ["The class-type that is generated is of the fully-qualified name." "This avoids a clash between the java.util.List type, and Lux's own List type." "All enum options to be imported must be specified." (import: java/lang/Character$UnicodeScript - ["[1]::[0]" - ("enum" ARABIC CYRILLIC LATIN)])] + "[1]::[0]" + ("enum" ARABIC CYRILLIC LATIN))] ["It should also be noted, the only types that may show up in method arguments or return values may be Java classes, arrays, primitives, void or type-vars." "Lux types, such as Maybe cannot be named (otherwise, they'd be confused for Java classes)." (import: (lux/concurrency/async/JvmAsync A) - ["[1]::[0]" - (resolve [A] boolean) - (poll [] A) - (wasResolved [] boolean) - (waitOn [lux/Function] void) - ("static" [A] make [A] (lux/concurrency/async/JvmAsync A))])] + "[1]::[0]" + (resolve [A] boolean) + (poll [] A) + (wasResolved [] boolean) + (waitOn [lux/Function] void) + ("static" [A] make [A] (lux/concurrency/async/JvmAsync A)))] ["Also, the names of the imported members will look like Class::member" (java/lang/Object::new []) (java/lang/Object::equals [other_object] my_object) diff --git a/stdlib/source/documentation/lux/ffi.old.lux b/stdlib/source/documentation/lux/ffi.old.lux index 6f27cb3f6..56336a41b 100644 --- a/stdlib/source/documentation/lux/ffi.old.lux +++ b/stdlib/source/documentation/lux/ffi.old.lux @@ -1,14 +1,14 @@ (.using - [library - [lux {"-" int char type :as} - ["$" documentation {"+" documentation:}] - [data - ["[0]" text {"+" \n} - ["%" format {"+" format}]]] - [macro - ["[0]" template]]]] - [\\library - ["[0]" /]]) + [library + [lux {"-" int char type :as} + ["$" documentation {"+" documentation:}] + [data + ["[0]" text {"+" \n} + ["%" format {"+" format}]]] + [macro + ["[0]" template]]]] + [\\library + ["[0]" /]]) (template [<name> <from> <to>] [(documentation: <name> @@ -142,44 +142,44 @@ (format "Allows importing JVM classes, and using them as types." \n "Their methods, fields and enum options can also be imported.") [(import: java/lang/Object - ["[1]::[0]" - (new []) - (equals [java/lang/Object] boolean) - (wait [int] "io" "try" void)])] + "[1]::[0]" + (new []) + (equals [java/lang/Object] boolean) + (wait [int] "io" "try" void))] ["Special options can also be given for the return values." "'?' means that the values will be returned inside a Maybe type. That way, null becomes .#None." "'try' means that the computation might throw an exception, and the return value will be wrapped by the Try type." "'io' means the computation has side effects, and will be wrapped by the IO type." "These options must show up in the following order ['io' 'try' '?'] (although, each option can be used independently)." (import: java/lang/String - ["[1]::[0]" - (new [[byte]]) - ("static" valueOf [char] java/lang/String) - ("static" valueOf "as" int_valueOf [int] java/lang/String)]) + "[1]::[0]" + (new [[byte]]) + ("static" valueOf [char] java/lang/String) + ("static" valueOf "as" int_valueOf [int] java/lang/String)) (import: (java/util/List e) - ["[1]::[0]" - (size [] int) - (get [int] e)]) + "[1]::[0]" + (size [] int) + (get [int] e)) (import: (java/util/ArrayList a) - ["[1]::[0]" - ([T] toArray [[T]] [T])])] + "[1]::[0]" + ([T] toArray [[T]] [T]))] ["The class-type that is generated is of the fully-qualified name." "This avoids a clash between the java.util.List type, and Lux's own List type." "All enum options to be imported must be specified." (import: java/lang/Character$UnicodeScript - ["[1]::[0]" - ("enum" ARABIC CYRILLIC LATIN)])] + "[1]::[0]" + ("enum" ARABIC CYRILLIC LATIN))] ["It should also be noted, the only types that may show up in method arguments or return values may be Java classes, arrays, primitives, void or type-parameters." "Lux types, such as Maybe cannot be named (otherwise, they'd be confused for Java classes)." (import: (lux/concurrency/async/JvmAsync A) - ["[1]::[0]" - (resolve [A] boolean) - (poll [] A) - (wasResolved [] boolean) - (waitOn [lux/Function] void) - ("static" [A] make [A] (lux/concurrency/async/JvmAsync A))])] + "[1]::[0]" + (resolve [A] boolean) + (poll [] A) + (wasResolved [] boolean) + (waitOn [lux/Function] void) + ("static" [A] make [A] (lux/concurrency/async/JvmAsync A)))] ["Also, the names of the imported members will look like Class::member" (java/lang/Object::new []) (java/lang/Object::equals [other_object] my_object) diff --git a/stdlib/source/documentation/lux/ffi.py.lux b/stdlib/source/documentation/lux/ffi.py.lux index 6b24c1926..34a88e01d 100644 --- a/stdlib/source/documentation/lux/ffi.py.lux +++ b/stdlib/source/documentation/lux/ffi.py.lux @@ -13,26 +13,26 @@ (documentation: /.import: "Easily import types, methods, functions and constants." [(import: os - ["[1]::[0]" - ("static" F_OK Integer) - ("static" R_OK Integer) - ("static" W_OK Integer) - ("static" X_OK Integer) + "[1]::[0]" + ("static" F_OK Integer) + ("static" R_OK Integer) + ("static" W_OK Integer) + ("static" X_OK Integer) - ("static" mkdir [String] "io" "try" "?" Any) - ("static" access [String Integer] "io" "try" Boolean) - ("static" remove [String] "io" "try" "?" Any) - ("static" rmdir [String] "io" "try" "?" Any) - ("static" rename [String String] "io" "try" "?" Any) - ("static" listdir [String] "io" "try" (Array String))]) + ("static" mkdir [String] "io" "try" "?" Any) + ("static" access [String Integer] "io" "try" Boolean) + ("static" remove [String] "io" "try" "?" Any) + ("static" rmdir [String] "io" "try" "?" Any) + ("static" rename [String String] "io" "try" "?" Any) + ("static" listdir [String] "io" "try" (Array String))) (import: os/path - ["[1]::[0]" - ("static" isfile [String] "io" "try" Boolean) - ("static" isdir [String] "io" "try" Boolean) - ("static" sep String) - ("static" getsize [String] "io" "try" Integer) - ("static" getmtime [String] "io" "try" Float)])]) + "[1]::[0]" + ("static" isfile [String] "io" "try" Boolean) + ("static" isdir [String] "io" "try" Boolean) + ("static" sep String) + ("static" getsize [String] "io" "try" Integer) + ("static" getmtime [String] "io" "try" Float))]) (documentation: /.lambda (format "Allows defining closures/anonymous-functions in the form that Python expects." diff --git a/stdlib/source/documentation/lux/ffi.rb.lux b/stdlib/source/documentation/lux/ffi.rb.lux index 33b4ef148..01b883a84 100644 --- a/stdlib/source/documentation/lux/ffi.rb.lux +++ b/stdlib/source/documentation/lux/ffi.rb.lux @@ -13,23 +13,23 @@ (documentation: /.import: "Easily import types, methods, functions and constants." [(import: Stat - ["[1]::[0]" - (executable? [] Bit) - (size Int)]) + "[1]::[0]" + (executable? [] Bit) + (size Int)) (import: File "as" RubyFile - ["[1]::[0]" - ("static" SEPARATOR ..String) - ("static" open [Path ..String] "io" "try" RubyFile) - ("static" stat [Path] "io" "try" Stat) - ("static" delete [Path] "io" "try" Int) - ("static" file? [Path] "io" "try" Bit) - ("static" directory? [Path] "io" "try" Bit) + "[1]::[0]" + ("static" SEPARATOR ..String) + ("static" open [Path ..String] "io" "try" RubyFile) + ("static" stat [Path] "io" "try" Stat) + ("static" delete [Path] "io" "try" Int) + ("static" file? [Path] "io" "try" Bit) + ("static" directory? [Path] "io" "try" Bit) - (read [] "io" "try" Binary) - (write [Binary] "io" "try" Int) - (flush [] "io" "try" "?" Any) - (close [] "io" "try" "?" Any)])]) + (read [] "io" "try" Binary) + (write [Binary] "io" "try" Int) + (flush [] "io" "try" "?" Any) + (close [] "io" "try" "?" Any))]) (.def: .public documentation (.List $.Module) diff --git a/stdlib/source/library/lux/control/concurrency/atom.lux b/stdlib/source/library/lux/control/concurrency/atom.lux index 5ce90157e..b15cecead 100644 --- a/stdlib/source/library/lux/control/concurrency/atom.lux +++ b/stdlib/source/library/lux/control/concurrency/atom.lux @@ -16,10 +16,10 @@ abstract]]]) (with_expansions [<jvm> (as_is (ffi.import: (java/util/concurrent/atomic/AtomicReference a) - ["[1]::[0]" - (new [a]) - (get [] "io" a) - (compareAndSet [a a] boolean)]))] + "[1]::[0]" + (new [a]) + (get [] "io" a) + (compareAndSet [a a] boolean)))] (for @.old <jvm> @.jvm <jvm> (as_is))) diff --git a/stdlib/source/library/lux/control/concurrency/thread.lux b/stdlib/source/library/lux/control/concurrency/thread.lux index 5f164eaae..6c2a36ebc 100644 --- a/stdlib/source/library/lux/control/concurrency/thread.lux +++ b/stdlib/source/library/lux/control/concurrency/thread.lux @@ -24,30 +24,35 @@ [// ["[0]" atom {"+" Atom}]]) -(with_expansions [<jvm> (as_is (ffi.import: java/lang/Object) - (ffi.import: java/lang/Long) +(with_expansions [<jvm> (as_is (ffi.import: java/lang/Object + "[1]::[0]") + + (ffi.import: java/lang/Long + "[1]::[0]") (ffi.import: java/lang/Runtime - ["[1]::[0]" - ("static" getRuntime [] java/lang/Runtime) - (availableProcessors [] int)]) + "[1]::[0]" + ("static" getRuntime [] java/lang/Runtime) + (availableProcessors [] int)) - (ffi.import: java/lang/Runnable) + (ffi.import: java/lang/Runnable + "[1]::[0]") (ffi.import: java/util/concurrent/TimeUnit - ["[1]::[0]" - ("enum" MILLISECONDS)]) + "[1]::[0]" + ("enum" MILLISECONDS)) (ffi.import: java/util/concurrent/Executor - ["[1]::[0]" - (execute [java/lang/Runnable] "io" void)]) + "[1]::[0]" + (execute [java/lang/Runnable] "io" void)) - (ffi.import: (java/util/concurrent/ScheduledFuture a)) + (ffi.import: (java/util/concurrent/ScheduledFuture a) + "[1]::[0]") (ffi.import: java/util/concurrent/ScheduledThreadPoolExecutor - ["[1]::[0]" - (new [int]) - (schedule [java/lang/Runnable long java/util/concurrent/TimeUnit] "io" (java/util/concurrent/ScheduledFuture java/lang/Object))]))] + "[1]::[0]" + (new [int]) + (schedule [java/lang/Runnable long java/util/concurrent/TimeUnit] "io" (java/util/concurrent/ScheduledFuture java/lang/Object))))] (for @.old (as_is <jvm>) @.jvm (as_is <jvm>) diff --git a/stdlib/source/library/lux/data/text/buffer.lux b/stdlib/source/library/lux/data/text/buffer.lux index 78652d3fe..98526e286 100644 --- a/stdlib/source/library/lux/data/text/buffer.lux +++ b/stdlib/source/library/lux/data/text/buffer.lux @@ -19,21 +19,22 @@ abstract]]] ["[0]" //]) -(with_expansions [<jvm> (as_is (import: java/lang/CharSequence) +(with_expansions [<jvm> (as_is (import: java/lang/CharSequence + "[1]::[0]") (import: java/lang/Appendable - ["[1]::[0]" - (append [java/lang/CharSequence] java/lang/Appendable)]) + "[1]::[0]" + (append [java/lang/CharSequence] java/lang/Appendable)) (import: java/lang/String - ["[1]::[0]" - (new [int]) - (toString [] java/lang/String)]) + "[1]::[0]" + (new [int]) + (toString [] java/lang/String)) (import: java/lang/StringBuilder - ["[1]::[0]" - (new [int]) - (toString [] java/lang/String)]))] + "[1]::[0]" + (new [int]) + (toString [] java/lang/String)))] (`` (for @.old (as_is <jvm>) @.jvm (as_is <jvm>) @.js (as_is (import: (JS_Array a) diff --git a/stdlib/source/library/lux/data/text/encoding/utf8.lux b/stdlib/source/library/lux/data/text/encoding/utf8.lux index 9b13114a4..a1627c8d2 100644 --- a/stdlib/source/library/lux/data/text/encoding/utf8.lux +++ b/stdlib/source/library/lux/data/text/encoding/utf8.lux @@ -12,9 +12,9 @@ ["[0]" //]) (with_expansions [<jvm> (as_is (ffi.import: java/lang/String - ["[1]::[0]" - (new [[byte] java/lang/String]) - (getBytes [java/lang/String] [byte])]))] + "[1]::[0]" + (new [[byte] java/lang/String]) + (getBytes [java/lang/String] [byte])))] (for @.old (as_is <jvm>) @.jvm (as_is <jvm>) diff --git a/stdlib/source/library/lux/debug.lux b/stdlib/source/library/lux/debug.lux index ef90dc663..a6d04ca55 100644 --- a/stdlib/source/library/lux/debug.lux +++ b/stdlib/source/library/lux/debug.lux @@ -41,31 +41,32 @@ [month {"+" Month}] [day {"+" Day}]]]]) -(with_expansions [<jvm> (as_is (import: java/lang/String) +(with_expansions [<jvm> (as_is (import: java/lang/String + "[1]::[0]") (import: (java/lang/Class a) - ["[1]::[0]" - (getCanonicalName [] java/lang/String)]) + "[1]::[0]" + (getCanonicalName [] java/lang/String)) (import: java/lang/Object - ["[1]::[0]" - (new []) - (toString [] java/lang/String) - (getClass [] (java/lang/Class java/lang/Object))]) + "[1]::[0]" + (new []) + (toString [] java/lang/String) + (getClass [] (java/lang/Class java/lang/Object))) (import: java/lang/Integer - ["[1]::[0]" - (longValue [] long)]) + "[1]::[0]" + (longValue [] long)) (import: java/lang/Long - ["[1]::[0]" - (intValue [] int)]) + "[1]::[0]" + (intValue [] int)) (import: java/lang/Number - ["[1]::[0]" - (intValue [] int) - (longValue [] long) - (doubleValue [] double)]))] + "[1]::[0]" + (intValue [] int) + (longValue [] long) + (doubleValue [] double)))] (for @.old (as_is <jvm>) @.jvm (as_is <jvm>) diff --git a/stdlib/source/library/lux/ffi.jvm.lux b/stdlib/source/library/lux/ffi.jvm.lux index 5720c4dff..3a53efeb9 100644 --- a/stdlib/source/library/lux/ffi.jvm.lux +++ b/stdlib/source/library/lux/ffi.jvm.lux @@ -999,13 +999,6 @@ #import_field_type gtype]}))) )) -(def: bundle - (-> (List (Type Var)) (Parser [Text (List Import_Member_Declaration)])) - (|>> ..import_member_decl^ - <>.some - (<>.and <code>.text) - <code>.tuple)) - (def: (privacy_modifier$ pm) (-> Privacy Code) (case pm @@ -1668,13 +1661,12 @@ (syntax: .public (import: [declaration ..declaration^ .let [[class_name class_type_vars] (parser.declaration declaration)] - bundles (<>.some (..bundle class_type_vars))]) + import_format <code>.text + members (<>.some (..import_member_decl^ class_type_vars))]) (do [! meta.monad] [kind (class_kind declaration) - =members (|> bundles - (list#each (function (_ [import_format members]) - (list#each (|>> [import_format]) members))) - list.together + =members (|> members + (list#each (|>> [import_format])) (monad.each ! (member_import$ class_type_vars kind declaration)))] (in (list& (class_import$ declaration) (list#conjoint =members))))) diff --git a/stdlib/source/library/lux/ffi.old.lux b/stdlib/source/library/lux/ffi.old.lux index 43a327049..caff78c66 100644 --- a/stdlib/source/library/lux/ffi.old.lux +++ b/stdlib/source/library/lux/ffi.old.lux @@ -968,13 +968,6 @@ #import_field_type gtype]}))) )) -(def: bundle - (-> (List Type_Parameter) (Parser [Text (List Import_Member_Declaration)])) - (|>> ..import_member_decl^ - <>.some - (<>.and <code>.text) - <code>.tuple)) - ... Generators (def: with_parens (-> JVM_Code JVM_Code) @@ -1618,13 +1611,12 @@ error))))) (syntax: .public (import: [class_decl ..class_decl^ - bundles (<>.some (..bundle (product.right class_decl)))]) + import_format <code>.text + members (<>.some (..import_member_decl^ (product.right class_decl)))]) (do [! meta.monad] [kind (class_kind class_decl) - =members (|> bundles - (list#each (function (_ [import_format members]) - (list#each (|>> [import_format]) members))) - list.together + =members (|> members + (list#each (|>> [import_format])) (monad.each ! (member_import$ (product.right class_decl) kind class_decl)))] (in (list& (class_import$ class_decl) (list#conjoint =members))))) diff --git a/stdlib/source/library/lux/target/jvm/bytecode.lux b/stdlib/source/library/lux/target/jvm/bytecode.lux index 29d93fad0..c104eb74a 100644 --- a/stdlib/source/library/lux/target/jvm/bytecode.lux +++ b/stdlib/source/library/lux/target/jvm/bytecode.lux @@ -560,12 +560,12 @@ (..bytecode $0 $1 @_ _.ldc_w/string [index])))) (import: java/lang/Float - ["[1]::[0]" - ("static" floatToRawIntBits "manual" [float] int)]) + "[1]::[0]" + ("static" floatToRawIntBits "manual" [float] int)) (import: java/lang/Double - ["[1]::[0]" - ("static" doubleToRawLongBits "manual" [double] long)]) + "[1]::[0]" + ("static" doubleToRawLongBits "manual" [double] long)) (template [<name> <type> <constructor> <constant> <wide> <to_lux> <specializations>] [(def: .public (<name> value) diff --git a/stdlib/source/library/lux/target/jvm/constant.lux b/stdlib/source/library/lux/target/jvm/constant.lux index 2dddcee7b..101e723fd 100644 --- a/stdlib/source/library/lux/target/jvm/constant.lux +++ b/stdlib/source/library/lux/target/jvm/constant.lux @@ -62,8 +62,8 @@ ) (import: java/lang/Float - ["[1]::[0]" - ("static" floatToRawIntBits "manual" [float] int)]) + "[1]::[0]" + ("static" floatToRawIntBits "manual" [float] int)) (implementation: .public float_equivalence (Equivalence java/lang/Float) @@ -78,8 +78,8 @@ ("jvm object cast" subject))))) (import: java/lang/Double - ["[1]::[0]" - ("static" doubleToRawLongBits [double] long)]) + "[1]::[0]" + ("static" doubleToRawLongBits [double] long)) (abstract: .public (Value kind) kind diff --git a/stdlib/source/library/lux/target/jvm/loader.lux b/stdlib/source/library/lux/target/jvm/loader.lux index ce31e2e12..5b0a65bb5 100644 --- a/stdlib/source/library/lux/target/jvm/loader.lux +++ b/stdlib/source/library/lux/target/jvm/loader.lux @@ -37,31 +37,32 @@ ["Error" error])) (import: java/lang/Object - ["[1]::[0]" - (getClass [] (java/lang/Class java/lang/Object))]) + "[1]::[0]" + (getClass [] (java/lang/Class java/lang/Object))) -(import: java/lang/String) +(import: java/lang/String + "[1]::[0]") (import: java/lang/reflect/Method - ["[1]::[0]" - (invoke [java/lang/Object [java/lang/Object]] "try" java/lang/Object)]) + "[1]::[0]" + (invoke [java/lang/Object [java/lang/Object]] "try" java/lang/Object)) (import: (java/lang/Class a) - ["[1]::[0]" - (getDeclaredMethod [java/lang/String [(java/lang/Class [? < java/lang/Object])]] java/lang/reflect/Method)]) + "[1]::[0]" + (getDeclaredMethod [java/lang/String [(java/lang/Class [? < java/lang/Object])]] java/lang/reflect/Method)) (import: java/lang/Integer - ["[1]::[0]" - ("static" TYPE (java/lang/Class java/lang/Integer))]) + "[1]::[0]" + ("static" TYPE (java/lang/Class java/lang/Integer))) (import: java/lang/reflect/AccessibleObject - ["[1]::[0]" - (setAccessible [boolean] void)]) + "[1]::[0]" + (setAccessible [boolean] void)) (import: java/lang/ClassLoader - ["[1]::[0]" - (loadClass [java/lang/String] - "io" "try" (java/lang/Class java/lang/Object))]) + "[1]::[0]" + (loadClass [java/lang/String] + "io" "try" (java/lang/Class java/lang/Object))) (with_expansions [<elemT> (as_is (java/lang/Class java/lang/Object))] (def: java/lang/ClassLoader::defineClass diff --git a/stdlib/source/library/lux/target/jvm/reflection.lux b/stdlib/source/library/lux/target/jvm/reflection.lux index 6d170ac6b..98896184c 100644 --- a/stdlib/source/library/lux/target/jvm/reflection.lux +++ b/stdlib/source/library/lux/target/jvm/reflection.lux @@ -30,65 +30,69 @@ ["[1][0]" reflection] ["[1][0]" parser]]]) -(import: java/lang/String) +(import: java/lang/String + "[1]::[0]") (import: java/lang/Object - ["[1]::[0]" - (toString [] java/lang/String) - (getClass [] (java/lang/Class java/lang/Object))]) + "[1]::[0]" + (toString [] java/lang/String) + (getClass [] (java/lang/Class java/lang/Object))) (import: java/lang/reflect/Type - ["[1]::[0]" - (getTypeName [] java/lang/String)]) + "[1]::[0]" + (getTypeName [] java/lang/String)) (import: java/lang/reflect/GenericArrayType - ["[1]::[0]" - (getGenericComponentType [] java/lang/reflect/Type)]) + "[1]::[0]" + (getGenericComponentType [] java/lang/reflect/Type)) (import: java/lang/reflect/ParameterizedType - ["[1]::[0]" - (getRawType [] java/lang/reflect/Type) - (getActualTypeArguments [] [java/lang/reflect/Type])]) + "[1]::[0]" + (getRawType [] java/lang/reflect/Type) + (getActualTypeArguments [] [java/lang/reflect/Type])) (import: (java/lang/reflect/TypeVariable d) - ["[1]::[0]" - (getName [] java/lang/String) - (getBounds [] [java/lang/reflect/Type])]) + "[1]::[0]" + (getName [] java/lang/String) + (getBounds [] [java/lang/reflect/Type])) (import: (java/lang/reflect/WildcardType d) - ["[1]::[0]" - (getLowerBounds [] [java/lang/reflect/Type]) - (getUpperBounds [] [java/lang/reflect/Type])]) + "[1]::[0]" + (getLowerBounds [] [java/lang/reflect/Type]) + (getUpperBounds [] [java/lang/reflect/Type])) (import: java/lang/reflect/Modifier - ["[1]::[0]" - ("static" isStatic [int] boolean) - ("static" isFinal [int] boolean) - ("static" isInterface [int] boolean) - ("static" isAbstract [int] boolean)]) + "[1]::[0]" + ("static" isStatic [int] boolean) + ("static" isFinal [int] boolean) + ("static" isInterface [int] boolean) + ("static" isAbstract [int] boolean)) -(import: java/lang/annotation/Annotation) +(import: java/lang/annotation/Annotation + "[1]::[0]") -(import: java/lang/Deprecated) +(import: java/lang/Deprecated + "[1]::[0]") (import: java/lang/reflect/Field - ["[1]::[0]" - (getDeclaringClass [] (java/lang/Class java/lang/Object)) - (getModifiers [] int) - (getGenericType [] java/lang/reflect/Type) - (getDeclaredAnnotations [] [java/lang/annotation/Annotation])]) + "[1]::[0]" + (getDeclaringClass [] (java/lang/Class java/lang/Object)) + (getModifiers [] int) + (getGenericType [] java/lang/reflect/Type) + (getDeclaredAnnotations [] [java/lang/annotation/Annotation])) -(import: java/lang/ClassLoader) +(import: java/lang/ClassLoader + "[1]::[0]") (import: (java/lang/Class c) - ["[1]::[0]" - ("static" forName [java/lang/String boolean java/lang/ClassLoader] "try" (java/lang/Class java/lang/Object)) - (getName [] java/lang/String) - (isAssignableFrom [(java/lang/Class java/lang/Object)] boolean) - (getTypeParameters [] [(java/lang/reflect/TypeVariable (java/lang/Class c))]) - (getDeclaredField [java/lang/String] "try" java/lang/reflect/Field) - (isArray [] boolean) - (getComponentType [] (java/lang/Class java/lang/Object))]) + "[1]::[0]" + ("static" forName [java/lang/String boolean java/lang/ClassLoader] "try" (java/lang/Class java/lang/Object)) + (getName [] java/lang/String) + (isAssignableFrom [(java/lang/Class java/lang/Object)] boolean) + (getTypeParameters [] [(java/lang/reflect/TypeVariable (java/lang/Class c))]) + (getDeclaredField [java/lang/String] "try" java/lang/reflect/Field) + (isArray [] boolean) + (getComponentType [] (java/lang/Class java/lang/Object))) (exception: .public (unknown_class [class External]) (exception.report diff --git a/stdlib/source/library/lux/target/python.lux b/stdlib/source/library/lux/target/python.lux index 2e991c91f..0f25e6eb2 100644 --- a/stdlib/source/library/lux/target/python.lux +++ b/stdlib/source/library/lux/target/python.lux @@ -34,10 +34,12 @@ (-> Text Text) (text.enclosed ["(" ")"])) -(for @.old (as_is (ffi.import: java/lang/CharSequence) +(for @.old (as_is (ffi.import: java/lang/CharSequence + "[1]::[0]") + (ffi.import: java/lang/String - ["[1]::[0]" - (replace [java/lang/CharSequence java/lang/CharSequence] java/lang/String)])) + "[1]::[0]" + (replace [java/lang/CharSequence java/lang/CharSequence] java/lang/String))) (as_is)) ... Added the carriage return for better Windows compatibility. diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux index ea13344ed..18e485a46 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux @@ -81,70 +81,73 @@ [module [descriptor {"+" Module}]]]]]]]]]) -(import: java/lang/ClassLoader) +(import: java/lang/ClassLoader + "[1]::[0]") (import: java/lang/Object - ["[1]::[0]" - (equals [java/lang/Object] boolean)]) + "[1]::[0]" + (equals [java/lang/Object] boolean)) -(import: java/lang/reflect/Type) +(import: java/lang/reflect/Type + "[1]::[0]") (import: (java/lang/reflect/TypeVariable d) - ["[1]::[0]" - (getName [] java/lang/String) - (getBounds [] [java/lang/reflect/Type])]) + "[1]::[0]" + (getName [] java/lang/String) + (getBounds [] [java/lang/reflect/Type])) (import: java/lang/reflect/Modifier - ["[1]::[0]" - ("static" isStatic [int] boolean) - ("static" isFinal [int] boolean) - ("static" isInterface [int] boolean) - ("static" isAbstract [int] boolean) - ("static" isPublic [int] boolean) - ("static" isProtected [int] boolean)]) + "[1]::[0]" + ("static" isStatic [int] boolean) + ("static" isFinal [int] boolean) + ("static" isInterface [int] boolean) + ("static" isAbstract [int] boolean) + ("static" isPublic [int] boolean) + ("static" isProtected [int] boolean)) -(import: java/lang/annotation/Annotation) +(import: java/lang/annotation/Annotation + "[1]::[0]") (import: java/lang/reflect/Method - ["[1]::[0]" - (getName [] java/lang/String) - (getModifiers [] int) - (getDeclaringClass [] (java/lang/Class java/lang/Object)) - (getTypeParameters [] [(java/lang/reflect/TypeVariable java/lang/reflect/Method)]) - (getGenericParameterTypes [] [java/lang/reflect/Type]) - (getDeclaredAnnotations [] [java/lang/annotation/Annotation]) - - (getReturnType [] (java/lang/Class java/lang/Object)) - (getGenericReturnType [] "?" java/lang/reflect/Type) - - (getExceptionTypes [] [(java/lang/Class java/lang/Object)]) - (getGenericExceptionTypes [] [java/lang/reflect/Type])]) + "[1]::[0]" + (getName [] java/lang/String) + (getModifiers [] int) + (getDeclaringClass [] (java/lang/Class java/lang/Object)) + (getTypeParameters [] [(java/lang/reflect/TypeVariable java/lang/reflect/Method)]) + (getGenericParameterTypes [] [java/lang/reflect/Type]) + (getDeclaredAnnotations [] [java/lang/annotation/Annotation]) + + (getReturnType [] (java/lang/Class java/lang/Object)) + (getGenericReturnType [] "?" java/lang/reflect/Type) + + (getExceptionTypes [] [(java/lang/Class java/lang/Object)]) + (getGenericExceptionTypes [] [java/lang/reflect/Type])) (import: (java/lang/reflect/Constructor c) - ["[1]::[0]" - (getModifiers [] int) - (getDeclaringClass [] (java/lang/Class c)) - (getTypeParameters [] [(java/lang/reflect/TypeVariable (java/lang/reflect/Constructor c))]) - (getGenericParameterTypes [] [java/lang/reflect/Type]) - (getExceptionTypes [] [(java/lang/Class java/lang/Object)]) - (getGenericExceptionTypes [] [java/lang/reflect/Type]) - (getDeclaredAnnotations [] [java/lang/annotation/Annotation])]) + "[1]::[0]" + (getModifiers [] int) + (getDeclaringClass [] (java/lang/Class c)) + (getTypeParameters [] [(java/lang/reflect/TypeVariable (java/lang/reflect/Constructor c))]) + (getGenericParameterTypes [] [java/lang/reflect/Type]) + (getExceptionTypes [] [(java/lang/Class java/lang/Object)]) + (getGenericExceptionTypes [] [java/lang/reflect/Type]) + (getDeclaredAnnotations [] [java/lang/annotation/Annotation])) (import: (java/lang/Class c) - ["[1]::[0]" - ("static" forName [java/lang/String] "try" (java/lang/Class java/lang/Object)) - (getName [] java/lang/String) - (getModifiers [] int) - (isAssignableFrom [(java/lang/Class java/lang/Object)] boolean) - (getTypeParameters [] [(java/lang/reflect/TypeVariable (java/lang/Class c))]) - (getGenericInterfaces [] [java/lang/reflect/Type]) - (getGenericSuperclass [] "?" java/lang/reflect/Type) - (getDeclaredField [java/lang/String] "try" java/lang/reflect/Field) - (getConstructors [] [(java/lang/reflect/Constructor java/lang/Object)]) - (getDeclaredMethods [] [java/lang/reflect/Method]) - (getDeclaredAnnotations [] [java/lang/annotation/Annotation]) - (getSuperclass [] "?" (java/lang/Class java/lang/Object)) - (getInterfaces [] [(java/lang/Class java/lang/Object)])]) + "[1]::[0]" + ("static" forName [java/lang/String] "try" (java/lang/Class java/lang/Object)) + (getName [] java/lang/String) + (getModifiers [] int) + (isAssignableFrom [(java/lang/Class java/lang/Object)] boolean) + (getTypeParameters [] [(java/lang/reflect/TypeVariable (java/lang/Class c))]) + (getGenericInterfaces [] [java/lang/reflect/Type]) + (getGenericSuperclass [] "?" java/lang/reflect/Type) + (getDeclaredField [java/lang/String] "try" java/lang/reflect/Field) + (getConstructors [] [(java/lang/reflect/Constructor java/lang/Object)]) + (getDeclaredMethods [] [java/lang/reflect/Method]) + (getDeclaredAnnotations [] [java/lang/annotation/Annotation]) + (getSuperclass [] "?" (java/lang/Class java/lang/Object)) + (getInterfaces [] [(java/lang/Class java/lang/Object)])) (template [<name>] [(exception: .public (<name> [class External @@ -551,7 +554,8 @@ {.#None} (in (jvm.class ..object_class (list))))) - {.#Ex id} + (^or {.#Ex id} + {.#Parameter id}) (phase#in (jvm.class ..object_class (list))) (^template [<tag>] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux index a69d511f3..8c314121a 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux @@ -961,7 +961,8 @@ _ (generation.log! (format "JVM Interface " (%.text name)))] (in directive.no_requirements))))])) -(import: java/lang/ClassLoader) +(import: java/lang/ClassLoader + "[1]::[0]") (def: .public (bundle class_loader extender) (-> java/lang/ClassLoader Extender (Bundle Anchor (Bytecode Any) Definition)) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/host.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/host.lux index d4c947953..dc3e63e85 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/host.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/host.lux @@ -49,18 +49,19 @@ ) (import: java/lang/reflect/Field - ["[1]::[0]" - (get ["?" java/lang/Object] "try" "?" java/lang/Object)]) + "[1]::[0]" + (get ["?" java/lang/Object] "try" "?" java/lang/Object)) (import: (java/lang/Class a) - ["[1]::[0]" - (getField [java/lang/String] "try" java/lang/reflect/Field)]) + "[1]::[0]" + (getField [java/lang/String] "try" java/lang/reflect/Field)) (import: java/lang/Object - ["[1]::[0]" - (getClass [] (java/lang/Class java/lang/Object))]) + "[1]::[0]" + (getClass [] (java/lang/Class java/lang/Object))) -(import: java/lang/ClassLoader) +(import: java/lang/ClassLoader + "[1]::[0]") (def: value::modifier ($_ modifier#composite field.public field.final field.static)) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/primitive.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/primitive.lux index 27cba044c..c1b79618b 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/primitive.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/primitive.lux @@ -79,8 +79,8 @@ (_.invokestatic $Double "valueOf" (type.method [(list) (list type.double) $Double (list)]))) (import: java/lang/Double - ["[1]::[0]" - ("static" doubleToRawLongBits "manual" [double] int)]) + "[1]::[0]" + ("static" doubleToRawLongBits "manual" [double] int)) (def: d0_bits Int diff --git a/stdlib/source/library/lux/tool/compiler/meta/packager/jvm.lux b/stdlib/source/library/lux/tool/compiler/meta/packager/jvm.lux index 4e1c841b5..1e27186b1 100644 --- a/stdlib/source/library/lux/tool/compiler/meta/packager/jvm.lux +++ b/stdlib/source/library/lux/tool/compiler/meta/packager/jvm.lux @@ -48,73 +48,75 @@ [jvm ["[0]" runtime {"+" Definition}]]]]]]]]]) -(import: java/lang/Object) +(import: java/lang/Object + "[1]::[0]") -(import: java/lang/String) +(import: java/lang/String + "[1]::[0]") (import: java/util/jar/Attributes - ["[1]::[0]" - (put [java/lang/Object java/lang/Object] "?" java/lang/Object)]) + "[1]::[0]" + (put [java/lang/Object java/lang/Object] "?" java/lang/Object)) (import: java/util/jar/Attributes$Name - ["[1]::[0]" - ("static" MAIN_CLASS java/util/jar/Attributes$Name) - ("static" MANIFEST_VERSION java/util/jar/Attributes$Name)]) + "[1]::[0]" + ("static" MAIN_CLASS java/util/jar/Attributes$Name) + ("static" MANIFEST_VERSION java/util/jar/Attributes$Name)) (import: java/util/jar/Manifest - ["[1]::[0]" - (new []) - (getMainAttributes [] java/util/jar/Attributes)]) + "[1]::[0]" + (new []) + (getMainAttributes [] java/util/jar/Attributes)) (import: java/io/Flushable - ["[1]::[0]" - (flush [] void)]) + "[1]::[0]" + (flush [] void)) (import: java/io/Closeable - ["[1]::[0]" - (close [] void)]) + "[1]::[0]" + (close [] void)) (import: java/io/OutputStream - ["[1]::[0]" - (write [[byte] int int] void)]) + "[1]::[0]" + (write [[byte] int int] void)) (import: java/io/ByteArrayOutputStream - ["[1]::[0]" - (new [int]) - (toByteArray [] [byte])]) + "[1]::[0]" + (new [int]) + (toByteArray [] [byte])) (import: java/util/zip/ZipEntry - ["[1]::[0]" - (getName [] java/lang/String) - (isDirectory [] boolean) - (getSize [] long)]) + "[1]::[0]" + (getName [] java/lang/String) + (isDirectory [] boolean) + (getSize [] long)) (import: java/util/zip/ZipOutputStream - ["[1]::[0]" - (write [[byte] int int] void) - (closeEntry [] void)]) + "[1]::[0]" + (write [[byte] int int] void) + (closeEntry [] void)) (import: java/util/jar/JarEntry - ["[1]::[0]" - (new [java/lang/String])]) + "[1]::[0]" + (new [java/lang/String])) (import: java/util/jar/JarOutputStream - ["[1]::[0]" - (new [java/io/OutputStream java/util/jar/Manifest]) - (putNextEntry [java/util/zip/ZipEntry] "try" void)]) + "[1]::[0]" + (new [java/io/OutputStream java/util/jar/Manifest]) + (putNextEntry [java/util/zip/ZipEntry] "try" void)) (import: java/io/ByteArrayInputStream - ["[1]::[0]" - (new [[byte]])]) + "[1]::[0]" + (new [[byte]])) (import: java/io/InputStream - ["[1]::[0]" - (read [[byte] int int] int)]) + "[1]::[0]" + (read [[byte] int int] int)) (import: java/util/jar/JarInputStream - ["[1]::[0]" - (new [java/io/InputStream]) - (getNextJarEntry [] "try" "?" java/util/jar/JarEntry)]) + "[1]::[0]" + (new [java/io/InputStream]) + (getNextJarEntry [] "try" "?" java/util/jar/JarEntry)) (def: byte 1) diff --git a/stdlib/source/library/lux/world/console.lux b/stdlib/source/library/lux/world/console.lux index b8f3f6cbc..5f0fef818 100644 --- a/stdlib/source/library/lux/world/console.lux +++ b/stdlib/source/library/lux/world/console.lux @@ -42,25 +42,26 @@ (exception: .public cannot_close) -(with_expansions [<jvm> (as_is (import: java/lang/String) +(with_expansions [<jvm> (as_is (import: java/lang/String + "[1]::[0]") (import: java/io/Console - ["[1]::[0]" - (readLine [] "io" "try" java/lang/String)]) + "[1]::[0]" + (readLine [] "io" "try" java/lang/String)) (import: java/io/InputStream - ["[1]::[0]" - (read [] "io" "try" int)]) + "[1]::[0]" + (read [] "io" "try" int)) (import: java/io/PrintStream - ["[1]::[0]" - (print [java/lang/String] "io" "try" void)]) + "[1]::[0]" + (print [java/lang/String] "io" "try" void)) (import: java/lang/System - ["[1]::[0]" - ("static" console [] "io" "?" java/io/Console) - ("static" in java/io/InputStream) - ("static" out java/io/PrintStream)]) + "[1]::[0]" + ("static" console [] "io" "?" java/io/Console) + ("static" in java/io/InputStream) + ("static" out java/io/PrintStream)) (exception: .public cannot_open) diff --git a/stdlib/source/library/lux/world/file.lux b/stdlib/source/library/lux/world/file.lux index 63fa2e88b..e3f87b053 100644 --- a/stdlib/source/library/lux/world/file.lux +++ b/stdlib/source/library/lux/world/file.lux @@ -157,47 +157,48 @@ [cannot_find_directory] ) -(with_expansions [<for_jvm> (as_is (ffi.import: java/lang/String) +(with_expansions [<for_jvm> (as_is (ffi.import: java/lang/String + "[1]::[0]") (`` (ffi.import: java/io/File - ["[1]::[0]" - (new [java/lang/String]) - (~~ (template [<name>] - [(<name> [] "io" "try" boolean)] - - [createNewFile] [mkdir] - [delete] - [isFile] [isDirectory] - [canRead] [canWrite] [canExecute])) - - (length [] "io" "try" long) - (listFiles [] "io" "try" "?" [java/io/File]) - (getAbsolutePath [] "io" "try" java/lang/String) - (renameTo [java/io/File] "io" "try" boolean) - (lastModified [] "io" "try" long) - (setLastModified [long] "io" "try" boolean) - ("static" separator java/lang/String)])) + "[1]::[0]" + (new [java/lang/String]) + (~~ (template [<name>] + [(<name> [] "io" "try" boolean)] + + [createNewFile] [mkdir] + [delete] + [isFile] [isDirectory] + [canRead] [canWrite] [canExecute])) + + (length [] "io" "try" long) + (listFiles [] "io" "try" "?" [java/io/File]) + (getAbsolutePath [] "io" "try" java/lang/String) + (renameTo [java/io/File] "io" "try" boolean) + (lastModified [] "io" "try" long) + (setLastModified [long] "io" "try" boolean) + ("static" separator java/lang/String))) (ffi.import: java/lang/AutoCloseable - ["[1]::[0]" - (close [] "io" "try" void)]) + "[1]::[0]" + (close [] "io" "try" void)) (ffi.import: java/io/OutputStream - ["[1]::[0]" - (write [[byte]] "io" "try" void) - (flush [] "io" "try" void)]) + "[1]::[0]" + (write [[byte]] "io" "try" void) + (flush [] "io" "try" void)) (ffi.import: java/io/FileOutputStream - ["[1]::[0]" - (new [java/io/File boolean] "io" "try")]) + "[1]::[0]" + (new [java/io/File boolean] "io" "try")) (ffi.import: java/io/InputStream - ["[1]::[0]" - (read [[byte]] "io" "try" int)]) + "[1]::[0]" + (read [[byte]] "io" "try" int)) (ffi.import: java/io/FileInputStream - ["[1]::[0]" - (new [java/io/File] "io" "try")]) + "[1]::[0]" + (new [java/io/File] "io" "try")) (`` (implementation: .public default (System IO) diff --git a/stdlib/source/library/lux/world/file/watch.lux b/stdlib/source/library/lux/world/file/watch.lux index a5828f116..65a75d232 100644 --- a/stdlib/source/library/lux/world/file/watch.lux +++ b/stdlib/source/library/lux/world/file/watch.lux @@ -262,14 +262,16 @@ [fs (..polling fs)])) -(with_expansions [<jvm> (as_is (import: java/lang/Object) +(with_expansions [<jvm> (as_is (import: java/lang/Object + "[1]::[0]") - (import: java/lang/String) + (import: java/lang/String + "[1]::[0]") (import: (java/util/List a) - ["[1]::[0]" - (size [] int) - (get [int] a)]) + "[1]::[0]" + (size [] int) + (get [int] a)) (def: (default_list list) (All (_ a) (-> (java/util/List a) (List a))) @@ -282,24 +284,26 @@ output}) output)))) - (import: (java/nio/file/WatchEvent$Kind a)) + (import: (java/nio/file/WatchEvent$Kind a) + "[1]::[0]") (import: (java/nio/file/WatchEvent a) - ["[1]::[0]" - (kind [] (java/nio/file/WatchEvent$Kind a))]) + "[1]::[0]" + (kind [] (java/nio/file/WatchEvent$Kind a))) - (import: java/nio/file/Watchable) + (import: java/nio/file/Watchable + "[1]::[0]") (import: java/nio/file/Path - ["[1]::[0]" - (register [java/nio/file/WatchService [(java/nio/file/WatchEvent$Kind [? < java/lang/Object])]] "io" "try" java/nio/file/WatchKey) - (toString [] java/lang/String)]) + "[1]::[0]" + (register [java/nio/file/WatchService [(java/nio/file/WatchEvent$Kind [? < java/lang/Object])]] "io" "try" java/nio/file/WatchKey) + (toString [] java/lang/String)) (import: java/nio/file/StandardWatchEventKinds - ["[1]::[0]" - ("static" ENTRY_CREATE (java/nio/file/WatchEvent$Kind java/nio/file/Path)) - ("static" ENTRY_MODIFY (java/nio/file/WatchEvent$Kind java/nio/file/Path)) - ("static" ENTRY_DELETE (java/nio/file/WatchEvent$Kind java/nio/file/Path))]) + "[1]::[0]" + ("static" ENTRY_CREATE (java/nio/file/WatchEvent$Kind java/nio/file/Path)) + ("static" ENTRY_MODIFY (java/nio/file/WatchEvent$Kind java/nio/file/Path)) + ("static" ENTRY_DELETE (java/nio/file/WatchEvent$Kind java/nio/file/Path))) (def: (default_event_concern event) (All (_ a) @@ -323,11 +327,11 @@ ))) (import: java/nio/file/WatchKey - ["[1]::[0]" - (reset [] "io" boolean) - (cancel [] "io" void) - (watchable [] java/nio/file/Watchable) - (pollEvents [] "io" (java/util/List (java/nio/file/WatchEvent ?)))]) + "[1]::[0]" + (reset [] "io" boolean) + (cancel [] "io" void) + (watchable [] java/nio/file/Watchable) + (pollEvents [] "io" (java/util/List (java/nio/file/WatchEvent ?)))) (def: default_key_concern (-> java/nio/file/WatchKey (IO Concern)) @@ -337,21 +341,21 @@ (list#mix ..also ..none))))) (import: java/nio/file/WatchService - ["[1]::[0]" - (poll [] "io" "try" "?" java/nio/file/WatchKey)]) + "[1]::[0]" + (poll [] "io" "try" "?" java/nio/file/WatchKey)) (import: java/nio/file/FileSystem - ["[1]::[0]" - (newWatchService [] "io" "try" java/nio/file/WatchService)]) + "[1]::[0]" + (newWatchService [] "io" "try" java/nio/file/WatchService)) (import: java/nio/file/FileSystems - ["[1]::[0]" - ("static" getDefault [] java/nio/file/FileSystem)]) + "[1]::[0]" + ("static" getDefault [] java/nio/file/FileSystem)) (import: java/io/File - ["[1]::[0]" - (new [java/lang/String]) - (toPath [] java/nio/file/Path)]) + "[1]::[0]" + (new [java/lang/String]) + (toPath [] java/nio/file/Path)) (type: Watch_Event (java/nio/file/WatchEvent$Kind java/lang/Object)) diff --git a/stdlib/source/library/lux/world/net/http/client.lux b/stdlib/source/library/lux/world/net/http/client.lux index 9ce51d32a..973ad7ca2 100644 --- a/stdlib/source/library/lux/world/net/http/client.lux +++ b/stdlib/source/library/lux/world/net/http/client.lux @@ -69,42 +69,44 @@ (-> Binary [Nat Binary]) [(binary.size data) data]) -(with_expansions [<jvm> (as_is (ffi.import: java/lang/String) +(with_expansions [<jvm> (as_is (ffi.import: java/lang/String + "[1]::[0]") (ffi.import: java/lang/AutoCloseable - ["[1]::[0]" - (close [] "io" "try" void)]) + "[1]::[0]" + (close [] "io" "try" void)) - (ffi.import: java/io/InputStream) + (ffi.import: java/io/InputStream + "[1]::[0]") (ffi.import: java/io/OutputStream - ["[1]::[0]" - (flush [] "io" "try" void) - (write [[byte]] "io" "try" void)]) + "[1]::[0]" + (flush [] "io" "try" void) + (write [[byte]] "io" "try" void)) (ffi.import: java/net/URLConnection - ["[1]::[0]" - (setDoOutput [boolean] "io" "try" void) - (setRequestProperty [java/lang/String java/lang/String] "io" "try" void) - (getInputStream [] "io" "try" java/io/InputStream) - (getOutputStream [] "io" "try" java/io/OutputStream) - (getHeaderFieldKey [int] "io" "try" "?" java/lang/String) - (getHeaderField [int] "io" "try" "?" java/lang/String)]) + "[1]::[0]" + (setDoOutput [boolean] "io" "try" void) + (setRequestProperty [java/lang/String java/lang/String] "io" "try" void) + (getInputStream [] "io" "try" java/io/InputStream) + (getOutputStream [] "io" "try" java/io/OutputStream) + (getHeaderFieldKey [int] "io" "try" "?" java/lang/String) + (getHeaderField [int] "io" "try" "?" java/lang/String)) (ffi.import: java/net/HttpURLConnection - ["[1]::[0]" - (setRequestMethod [java/lang/String] "io" "try" void) - (getResponseCode [] "io" "try" int)]) + "[1]::[0]" + (setRequestMethod [java/lang/String] "io" "try" void) + (getResponseCode [] "io" "try" int)) (ffi.import: java/net/URL - ["[1]::[0]" - (new [java/lang/String]) - (openConnection [] "io" "try" java/net/URLConnection)]) + "[1]::[0]" + (new [java/lang/String]) + (openConnection [] "io" "try" java/net/URLConnection)) (ffi.import: java/io/BufferedInputStream - ["[1]::[0]" - (new [java/io/InputStream]) - (read [[byte] int int] "io" "try" int)]) + "[1]::[0]" + (new [java/io/InputStream]) + (read [[byte] int int] "io" "try" int)) (def: jvm_method (-> //.Method Text) diff --git a/stdlib/source/library/lux/world/program.lux b/stdlib/source/library/lux/world/program.lux index c3870d14d..3da3c779f 100644 --- a/stdlib/source/library/lux/world/program.lux +++ b/stdlib/source/library/lux/world/program.lux @@ -115,27 +115,28 @@ ... Do not trust the values of environment variables ... https://wiki.sei.cmu.edu/confluence/display/java/ENV02-J.+Do+not+trust+the+values+of+environment+variables -(with_expansions [<jvm> (as_is (import: java/lang/String) +(with_expansions [<jvm> (as_is (import: java/lang/String + "[1]::[0]") (import: (java/util/Iterator a) - ["[1]::[0]" - (hasNext [] boolean) - (next [] a)]) + "[1]::[0]" + (hasNext [] boolean) + (next [] a)) (import: (java/util/Set a) - ["[1]::[0]" - (iterator [] (java/util/Iterator a))]) + "[1]::[0]" + (iterator [] (java/util/Iterator a))) (import: (java/util/Map k v) - ["[1]::[0]" - (keySet [] (java/util/Set k))]) + "[1]::[0]" + (keySet [] (java/util/Set k))) (import: java/lang/System - ["[1]::[0]" - ("static" getenv [] (java/util/Map java/lang/String java/lang/String)) - ("static" getenv "as" resolveEnv [java/lang/String] "io" "?" java/lang/String) - ("static" getProperty [java/lang/String] "?" java/lang/String) - ("static" exit [int] "io" void)]) + "[1]::[0]" + ("static" getenv [] (java/util/Map java/lang/String java/lang/String)) + ("static" getenv "as" resolveEnv [java/lang/String] "io" "?" java/lang/String) + ("static" getProperty [java/lang/String] "?" java/lang/String) + ("static" exit [int] "io" void)) (def: (jvm##consume iterator) (All (_ a) (-> (java/util/Iterator a) (List a))) diff --git a/stdlib/source/library/lux/world/shell.lux b/stdlib/source/library/lux/world/shell.lux index 154fb6290..d77f1aa2f 100644 --- a/stdlib/source/library/lux/world/shell.lux +++ b/stdlib/source/library/lux/world/shell.lux @@ -171,8 +171,8 @@ (..policy safe_command safe_argument))) (with_expansions [<jvm> (as_is (import: java/lang/String - ["[1]::[0]" - (toLowerCase [] java/lang/String)]) + "[1]::[0]" + (toLowerCase [] java/lang/String)) (def: (jvm::arguments_array arguments) (-> (List Argument) (Array java/lang/String)) @@ -185,8 +185,8 @@ arguments))) (import: (java/util/Map k v) - ["[1]::[0]" - (put [k v] v)]) + "[1]::[0]" + (put [k v] v)) (def: (jvm::load_environment input target) (-> Environment @@ -202,31 +202,32 @@ (dictionary.entries input))) (import: java/io/Reader - ["[1]::[0]" - (read [] "io" "try" int)]) + "[1]::[0]" + (read [] "io" "try" int)) (import: java/io/BufferedReader - ["[1]::[0]" - (new [java/io/Reader]) - (readLine [] "io" "try" "?" java/lang/String)]) + "[1]::[0]" + (new [java/io/Reader]) + (readLine [] "io" "try" "?" java/lang/String)) - (import: java/io/InputStream) + (import: java/io/InputStream + "[1]::[0]") (import: java/io/InputStreamReader - ["[1]::[0]" - (new [java/io/InputStream])]) + "[1]::[0]" + (new [java/io/InputStream])) (import: java/io/OutputStream - ["[1]::[0]" - (write [[byte]] "io" "try" void)]) + "[1]::[0]" + (write [[byte]] "io" "try" void)) (import: java/lang/Process - ["[1]::[0]" - (getInputStream [] "io" "try" java/io/InputStream) - (getErrorStream [] "io" "try" java/io/InputStream) - (getOutputStream [] "io" "try" java/io/OutputStream) - (destroy [] "io" "try" void) - (waitFor [] "io" "try" int)]) + "[1]::[0]" + (getInputStream [] "io" "try" java/io/InputStream) + (getErrorStream [] "io" "try" java/io/InputStream) + (getOutputStream [] "io" "try" java/io/OutputStream) + (destroy [] "io" "try" void) + (waitFor [] "io" "try" int)) (exception: .public no_more_output) @@ -269,19 +270,19 @@ )))))))) (import: java/io/File - ["[1]::[0]" - (new [java/lang/String])]) + "[1]::[0]" + (new [java/lang/String])) (import: java/lang/ProcessBuilder - ["[1]::[0]" - (new [[java/lang/String]]) - (environment [] "try" (java/util/Map java/lang/String java/lang/String)) - (directory [java/io/File] java/lang/ProcessBuilder) - (start [] "io" "try" java/lang/Process)]) + "[1]::[0]" + (new [[java/lang/String]]) + (environment [] "try" (java/util/Map java/lang/String java/lang/String)) + (directory [java/io/File] java/lang/ProcessBuilder) + (start [] "io" "try" java/lang/Process)) (import: java/lang/System - ["[1]::[0]" - ("static" getProperty [java/lang/String] "io" "try" java/lang/String)]) + "[1]::[0]" + ("static" getProperty [java/lang/String] "io" "try" java/lang/String)) ... https://en.wikipedia.org/wiki/Code_injection#Shell_injection (def: windows? diff --git a/stdlib/source/program/aedifex/command/build.lux b/stdlib/source/program/aedifex/command/build.lux index a0cd97fd9..ecbcb703f 100644 --- a/stdlib/source/program/aedifex/command/build.lux +++ b/stdlib/source/program/aedifex/command/build.lux @@ -236,8 +236,8 @@ ) (import: java/lang/System - ["[1]::[0]" - ("static" getProperty [java/lang/String] "io" "try" java/lang/String)]) + "[1]::[0]" + ("static" getProperty [java/lang/String] "io" "try" java/lang/String)) (def: windows? Bit diff --git a/stdlib/source/program/aedifex/dependency/resolution.lux b/stdlib/source/program/aedifex/dependency/resolution.lux index 1fcc77dd7..2100c1ca1 100644 --- a/stdlib/source/program/aedifex/dependency/resolution.lux +++ b/stdlib/source/program/aedifex/dependency/resolution.lux @@ -72,8 +72,8 @@ ) (import: java/lang/String - ["[1]::[0]" - (trim [] java/lang/String)]) + "[1]::[0]" + (trim [] java/lang/String)) (def: (verified_hash library repository version_template artifact extension hash codec exception) (All (_ h) diff --git a/stdlib/source/program/aedifex/hash.lux b/stdlib/source/program/aedifex/hash.lux index 30b0cdcee..23421b264 100644 --- a/stdlib/source/program/aedifex/hash.lux +++ b/stdlib/source/program/aedifex/hash.lux @@ -24,12 +24,13 @@ ... TODO: Replace with pure-Lux implementations of these algorithms ... https://en.wikipedia.org/wiki/SHA-1#SHA-1_pseudocode ... https://en.wikipedia.org/wiki/MD5#Algorithm -(import: java/lang/String) +(import: java/lang/String + "[1]::[0]") (import: java/security/MessageDigest - ["[1]::[0]" - ("static" getInstance [java/lang/String] java/security/MessageDigest) - (digest [[byte]] [byte])]) + "[1]::[0]" + ("static" getInstance [java/lang/String] java/security/MessageDigest) + (digest [[byte]] [byte])) (abstract: .public SHA-1 Any) (abstract: .public MD5 Any) diff --git a/stdlib/source/program/aedifex/repository/identity.lux b/stdlib/source/program/aedifex/repository/identity.lux index 8288f2d74..6ab4e380d 100644 --- a/stdlib/source/program/aedifex/repository/identity.lux +++ b/stdlib/source/program/aedifex/repository/identity.lux @@ -30,12 +30,12 @@ )) (import: java/util/Base64$Encoder - ["[1]::[0]" - (encodeToString [[byte]] java/lang/String)]) + "[1]::[0]" + (encodeToString [[byte]] java/lang/String)) (import: java/util/Base64 - ["[1]::[0]" - ("static" getEncoder [] java/util/Base64$Encoder)]) + "[1]::[0]" + ("static" getEncoder [] java/util/Base64$Encoder)) (def: .public (basic_auth user password) (-> User Password Text) diff --git a/stdlib/source/test/lux/ffi.jvm.lux b/stdlib/source/test/lux/ffi.jvm.lux index a7d5c88bb..74107be7d 100644 --- a/stdlib/source/test/lux/ffi.jvm.lux +++ b/stdlib/source/test/lux/ffi.jvm.lux @@ -39,16 +39,21 @@ ["$[0]" / "_" ["[1][0]" export]]) -(/.import: java/lang/Boolean) -(/.import: java/lang/Long) +(/.import: java/lang/Boolean + "[1]::[0]") -(/.import: java/lang/String) +(/.import: java/lang/Long + "[1]::[0]") -(/.import: java/lang/Object) +(/.import: java/lang/String + "[1]::[0]") + +(/.import: java/lang/Object + "[1]::[0]") (/.import: (java/lang/Class a) - ["[1]::[0]" - (getName [] java/lang/String)]) + "[1]::[0]" + (getName [] java/lang/String)) (template [<name> <type> <conversion> <lux> <=>] [(def: (<name> left right) @@ -257,36 +262,36 @@ ([] actual0 [] java/lang/Long)) (/.import: test/TestInterface0 - ["[1]::[0]" - (actual0 [] java/lang/Long)]) + "[1]::[0]" + (actual0 [] java/lang/Long)) (/.interface: test/TestInterface1 ([] actual1 [java/lang/Boolean] java/lang/Long "throws" [java/lang/Throwable])) (/.import: test/TestInterface1 - ["[1]::[0]" - (actual1 [java/lang/Boolean] "try" java/lang/Long)]) + "[1]::[0]" + (actual1 [java/lang/Boolean] "try" java/lang/Long)) (/.interface: test/TestInterface2 ([a] actual2 [a] a)) (/.import: test/TestInterface2 - ["[1]::[0]" - ([a] actual2 [a] a)]) + "[1]::[0]" + ([a] actual2 [a] a)) (/.interface: (test/TestInterface3 a) ([] actual3 [] a)) (/.import: (test/TestInterface3 a) - ["[1]::[0]" - (actual3 [] a)]) + "[1]::[0]" + (actual3 [] a)) (/.interface: test/TestInterface4 ([] actual4 [long long] long)) (/.import: test/TestInterface4 - ["[1]::[0]" - (actual4 [long long] long)]) + "[1]::[0]" + (actual4 [long long] long)) (def: for_interface Test @@ -379,8 +384,8 @@ ::value)) (/.import: test/TestClass0 - ["[1]::[0]" - (new [java/lang/Long])]) + "[1]::[0]" + (new [java/lang/Long])) (/.class: "final" test/TestClass1 [test/TestInterface1] ... Fields @@ -397,8 +402,8 @@ ::value))) (/.import: test/TestClass1 - ["[1]::[0]" - (new [java/lang/Long])]) + "[1]::[0]" + (new [java/lang/Long])) (/.class: "final" test/TestClass2 [test/TestInterface2] ... Constructors @@ -411,8 +416,8 @@ input)) (/.import: test/TestClass2 - ["[1]::[0]" - (new [])]) + "[1]::[0]" + (new [])) (/.class: "final" (test/TestClass3 a) [(test/TestInterface3 a)] ... Fields @@ -427,8 +432,8 @@ ::value)) (/.import: (test/TestClass3 a) - ["[1]::[0]" - (new [a])]) + "[1]::[0]" + (new [a])) (/.class: "final" test/TestClass4 [] ... Constructors @@ -439,9 +444,9 @@ value)) (/.import: test/TestClass4 - ["[1]::[0]" - (new []) - (actual4 [java/lang/Long] java/lang/Long)]) + "[1]::[0]" + (new []) + (actual4 [java/lang/Long] java/lang/Long)) (/.class: "final" test/TestClass5 [] ... Constructors @@ -453,8 +458,8 @@ value)) (/.import: test/TestClass5 - ["[1]::[0]" - ("static" actual5 [java/lang/Long] java/lang/Long)]) + "[1]::[0]" + ("static" actual5 [java/lang/Long] java/lang/Long)) (/.class: "abstract" test/TestClass6 [] ... Constructors @@ -465,8 +470,8 @@ java/lang/Long)) (/.import: test/TestClass6 - ["[1]::[0]" - (actual6 [java/lang/Long] java/lang/Long)]) + "[1]::[0]" + (actual6 [java/lang/Long] java/lang/Long)) (/.class: "final" test/TestClass7 test/TestClass6 [] ... Constructors @@ -479,8 +484,8 @@ input)) (/.import: test/TestClass7 - ["[1]::[0]" - (new [])]) + "[1]::[0]" + (new [])) (/.class: "final" test/TestClass8 [test/TestInterface4] ... Constructors @@ -496,8 +501,8 @@ (/.of_long actual_right))))) (/.import: test/TestClass8 - ["[1]::[0]" - (new [])]) + "[1]::[0]" + (new [])) (/.class: "final" (test/TestClass9 a) [] ... Fields @@ -512,10 +517,10 @@ ::value9)) (/.import: (test/TestClass9 a) - ["[1]::[0]" - (new [a]) - (set_actual9 [a] void) - (get_actual9 [] a)]) + "[1]::[0]" + (new [a]) + (set_actual9 [a] void) + (get_actual9 [] a)) (def: for_class Test @@ -632,11 +637,11 @@ (not (expands? (/.import: <class>))))) (_.cover [/.class_name_cannot_be_a_type_variable] (and (not (expands? (/.import: (java/lang/Double a) - ["[1]::[0]" - (invalid [] (a java/lang/String))]))) + "[1]::[0]" + (invalid [] (a java/lang/String))))) (not (expands? (/.import: java/lang/Double - ["[1]::[0]" - ([a] invalid [] (a java/lang/String))]))))) + "[1]::[0]" + ([a] invalid [] (a java/lang/String))))))) (_.cover [/.unknown_type_variable] (let [type_variable ((debug.private /.type_variable) (list (jvm.var var/0) (jvm.var var/1)))] (and (|> (list (code.local_symbol var/0)) diff --git a/stdlib/source/test/lux/ffi.old.lux b/stdlib/source/test/lux/ffi.old.lux index fc503636a..1a9db190f 100644 --- a/stdlib/source/test/lux/ffi.old.lux +++ b/stdlib/source/test/lux/ffi.old.lux @@ -1,37 +1,40 @@ (.using - [library - [lux "*" - ["_" test {"+" Test}] - [abstract - [equivalence {"+" Equivalence}] - [monad {"+" do}]] - [control - [pipe {"+" case>}]] - [data - ["[0]" text ("[1]#[0]" equivalence) - ["%" format {"+" format}]]] - [macro - ["[0]" template]] - [math - ["[0]" random] - [number - ["n" nat] - ["i" int] - ["f" frac]]] - ["[0]" type ("[1]#[0]" equivalence)]]] - [\\library - ["[0]" /]]) - -(/.import: java/lang/Object) -(/.import: java/lang/String) + [library + [lux "*" + ["_" test {"+" Test}] + [abstract + [equivalence {"+" Equivalence}] + [monad {"+" do}]] + [control + [pipe {"+" case>}]] + [data + ["[0]" text ("[1]#[0]" equivalence) + ["%" format {"+" format}]]] + [macro + ["[0]" template]] + [math + ["[0]" random] + [number + ["n" nat] + ["i" int] + ["f" frac]]] + ["[0]" type ("[1]#[0]" equivalence)]]] + [\\library + ["[0]" /]]) + +(/.import: java/lang/Object + "[1]::[0]") + +(/.import: java/lang/String + "[1]::[0]") (/.import: java/lang/Exception - ["[1]::[0]" - (new [java/lang/String])]) + "[1]::[0]" + (new [java/lang/String])) (/.import: (java/lang/Class a) - ["[1]::[0]" - (getName [] java/lang/String)]) + "[1]::[0]" + (getName [] java/lang/String)) (/.class: "final" (TestClass A) [] ... Fields @@ -51,11 +54,11 @@ (:= ::counter (i.- ::increase ::counter)))) (/.import: (test/lux/ffi/TestClass a) - ["[1]::[0]" - (new [java/lang/Long java/lang/Long]) - (currentC [] java/lang/Long) - (upC [] void) - (downC [] void)]) + "[1]::[0]" + (new [java/lang/Long java/lang/Long]) + (currentC [] java/lang/Long) + (upC [] void) + (downC [] void)) (/.interface: TestInterface ([] current [] java/lang/Long "throws" [java/lang/Exception]) @@ -63,10 +66,10 @@ ([] down [] test/lux/ffi/TestInterface "throws" [java/lang/Exception])) (/.import: test/lux/ffi/TestInterface - ["[1]::[0]" - (current [] java/lang/Long) - (up [] java/lang/Long) - (down [] java/lang/Long)]) + "[1]::[0]" + (current [] java/lang/Long) + (up [] java/lang/Long) + (down [] java/lang/Long)) (def: (test_object increase counter) (-> Int Int test/lux/ffi/TestInterface) diff --git a/stdlib/source/test/lux/ffi/export.jvm.lux b/stdlib/source/test/lux/ffi/export.jvm.lux index 24ef68929..cde493f1f 100644 --- a/stdlib/source/test/lux/ffi/export.jvm.lux +++ b/stdlib/source/test/lux/ffi/export.jvm.lux @@ -67,29 +67,29 @@ ))) (`` (`` (//.import: Primitives - ["[1]::[0]" - ("static" actual_boolean boolean) - ("static" actual_byte byte) - ("static" actual_short short) - ("static" actual_int int) - ("static" actual_long long) - ("static" actual_char char) - ("static" actual_float float) - ("static" actual_double double) - - (~~ (template [<type>] - [("static" (~~ (template.symbol [<type> "_method"])) [<type> <type>] <type>)] - - [boolean] - [byte] - [short] - [int] - [long] - [char] - [float] - [double] - )) - ]))) + "[1]::[0]" + ("static" actual_boolean boolean) + ("static" actual_byte byte) + ("static" actual_short short) + ("static" actual_int int) + ("static" actual_long long) + ("static" actual_char char) + ("static" actual_float float) + ("static" actual_double double) + + (~~ (template [<type>] + [("static" (~~ (template.symbol [<type> "_method"])) [<type> <type>] <type>)] + + [boolean] + [byte] + [short] + [int] + [long] + [char] + [float] + [double] + )) + ))) (/.export: Objects (actual_string java/lang/String ..expected_string) @@ -102,13 +102,13 @@ (([a] right [left a right a]) a right)) (//.import: Objects - ["[1]::[0]" - ("static" actual_string java/lang/String) + "[1]::[0]" + ("static" actual_string java/lang/String) - ("static" string_method [java/lang/String java/lang/String] java/lang/String) - - ("static" [a] left [a a] a) - ("static" [a] right [a a] a)]) + ("static" string_method [java/lang/String java/lang/String] java/lang/String) + + ("static" [a] left [a a] a) + ("static" [a] right [a a] a)) (def: tiny_int (Random Int) diff --git a/stdlib/source/test/lux/math/number/frac.lux b/stdlib/source/test/lux/math/number/frac.lux index c8b786701..f78b23afd 100644 --- a/stdlib/source/test/lux/math/number/frac.lux +++ b/stdlib/source/test/lux/math/number/frac.lux @@ -119,9 +119,9 @@ ))) (with_expansions [<jvm> (as_is (ffi.import: java/lang/Double - ["[1]::[0]" - ("static" doubleToRawLongBits [double] long) - ("static" longBitsToDouble [long] double)]))] + "[1]::[0]" + ("static" doubleToRawLongBits [double] long) + ("static" longBitsToDouble [long] double)))] (for @.old (as_is <jvm>) @.jvm (as_is <jvm>) (as_is))) diff --git a/stdlib/source/test/lux/target/jvm.lux b/stdlib/source/test/lux/target/jvm.lux index 562473fb0..5a919761c 100644 --- a/stdlib/source/test/lux/target/jvm.lux +++ b/stdlib/source/test/lux/target/jvm.lux @@ -59,30 +59,46 @@ /method.public /method.static)) -(import: java/lang/Boolean) -(import: java/lang/Byte) -(import: java/lang/Short) -(import: java/lang/Integer) -(import: java/lang/Long) -(import: java/lang/Float) +(import: java/lang/Boolean + "[1]::[0]") + +(import: java/lang/Byte + "[1]::[0]") + +(import: java/lang/Short + "[1]::[0]") + +(import: java/lang/Integer + "[1]::[0]") + +(import: java/lang/Long + "[1]::[0]") + +(import: java/lang/Float + "[1]::[0]") + (import: java/lang/Double - ["[1]::[0]" - ("static" compare [double double] int)]) -(import: java/lang/Character) -(import: java/lang/String) + "[1]::[0]" + ("static" compare [double double] int)) + +(import: java/lang/Character + "[1]::[0]") + +(import: java/lang/String + "[1]::[0]") (import: java/lang/reflect/Method - ["[1]::[0]" - (invoke [java/lang/Object [java/lang/Object]] "try" java/lang/Object)]) + "[1]::[0]" + (invoke [java/lang/Object [java/lang/Object]] "try" java/lang/Object)) (import: (java/lang/Class c) - ["[1]::[0]" - (getDeclaredMethod [java/lang/String [(java/lang/Class [? < java/lang/Object])]] java/lang/reflect/Method)]) + "[1]::[0]" + (getDeclaredMethod [java/lang/String [(java/lang/Class [? < java/lang/Object])]] java/lang/reflect/Method)) (import: java/lang/Object - ["[1]::[0]" - (getClass [] (java/lang/Class java/lang/Object)) - (toString [] java/lang/String)]) + "[1]::[0]" + (getClass [] (java/lang/Class java/lang/Object)) + (toString [] java/lang/String)) (def: class_name (Random Text) diff --git a/stdlib/source/unsafe/lux/data/binary.lux b/stdlib/source/unsafe/lux/data/binary.lux index e7936fd06..a36223c05 100644 --- a/stdlib/source/unsafe/lux/data/binary.lux +++ b/stdlib/source/unsafe/lux/data/binary.lux @@ -17,16 +17,17 @@ (with_expansions [<jvm> (as_is (type: .public Binary (ffi.type [byte])) - (ffi.import: java/lang/Object) + (ffi.import: java/lang/Object + "[1]::[0]") (ffi.import: java/lang/System - ["[1]::[0]" - ("static" arraycopy [java/lang/Object int java/lang/Object int int] void)]) + "[1]::[0]" + ("static" arraycopy [java/lang/Object int java/lang/Object int int] void)) (ffi.import: java/util/Arrays - ["[1]::[0]" - ("static" copyOfRange [[byte] int int] [byte]) - ("static" equals [[byte] [byte]] boolean)]))] + "[1]::[0]" + ("static" copyOfRange [[byte] int int] [byte]) + ("static" equals [[byte] [byte]] boolean)))] (for @.old (as_is <jvm>) @.jvm (as_is <jvm>) |