diff options
author | Eduardo Julian | 2022-06-14 02:33:54 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-06-14 02:33:54 -0400 |
commit | c4d938ebb2f5245b4c3faa22c4f217e7e818589f (patch) | |
tree | b4ffb4ece96cd711c270932ca500c49192c6bb46 | |
parent | 63dec2e80905100ae2b48ada1d4e0d675338d00f (diff) |
Better syntax for invoking super methods inside overriden methods.
Diffstat (limited to '')
39 files changed, 493 insertions, 219 deletions
diff --git a/.gitignore b/.gitignore index 606ff0d0a..46bfd201f 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ aedifex.jar /lux-jvm/source/program /lux-jvm/source/spec /lux-jvm/source/parser +/lux-jvm/source/format /lux-js/RELEASE /lux-js/target @@ -34,6 +35,7 @@ aedifex.jar /lux-js/source/program /lux-js/source/spec /lux-js/source/parser +/lux-js/source/format /lux-js/node_based_compiler.js /lux-js/lux.js @@ -44,6 +46,7 @@ aedifex.jar /lux-python/source/program /lux-python/source/spec /lux-python/source/parser +/lux-python/source/format /lux-lua/RELEASE /lux-lua/target @@ -52,6 +55,7 @@ aedifex.jar /lux-lua/source/program /lux-lua/source/spec /lux-lua/source/parser +/lux-lua/source/format /lux-ruby/RELEASE /lux-ruby/target @@ -60,6 +64,7 @@ aedifex.jar /lux-ruby/source/program /lux-ruby/source/spec /lux-ruby/source/parser +/lux-ruby/source/format /stdlib/RELEASE /stdlib/target diff --git a/documentation/bookmark/business/leadership.md b/documentation/bookmark/business/leadership.md index e42f7508d..1cb296655 100644 --- a/documentation/bookmark/business/leadership.md +++ b/documentation/bookmark/business/leadership.md @@ -1,4 +1,5 @@ # Reference +0. [How Patience Pays Off](https://www.permanentequity.com/writings/how-patience-pays-off) 0. [Why Agile Turns into Micromanagement](https://age-of-product.com/agile-micromanagement/) diff --git a/documentation/bookmark/business/management.md b/documentation/bookmark/business/management.md index d9e468e39..2d17f7e31 100644 --- a/documentation/bookmark/business/management.md +++ b/documentation/bookmark/business/management.md @@ -1,5 +1,6 @@ # Reference +0. [Preventing burnout: A manager's toolkit](https://about.gitlab.com/blog/2022/05/03/preventing-burnout-a-managers-toolkit/) 0. [The Curse of Systems Thinkers (Part 1)](https://blog.relyabilit.ie/the-curse-of-systems-thinkers/) 0. [Democracy Without Elections](https://democracywithoutelections.org/) 0. [First, Let’s Fire All the Managers](https://hbr.org/2011/12/first-lets-fire-all-the-managers) diff --git a/documentation/bookmark/concurrency/actor.md b/documentation/bookmark/concurrency/actor.md index bf6a3b621..0d4019add 100644 --- a/documentation/bookmark/concurrency/actor.md +++ b/documentation/bookmark/concurrency/actor.md @@ -1,4 +1,5 @@ # Reference -1. [otplike – Erlang/OTP processes and behaviours for Clojure - Alexey Aristov](https://www.youtube.com/watch?v=nHvRbZZhUDQ) +0. [proto.actor](https://proto.actor/) +0. [otplike – Erlang/OTP processes and behaviours for Clojure - Alexey Aristov](https://www.youtube.com/watch?v=nHvRbZZhUDQ) diff --git a/documentation/bookmark/concurrency/session_types.md b/documentation/bookmark/concurrency/session_types.md new file mode 100644 index 000000000..b9b9a0569 --- /dev/null +++ b/documentation/bookmark/concurrency/session_types.md @@ -0,0 +1,4 @@ +# Reference + +0. [An Introduction to Session Types](https://wen.works/2020/12/17/an-introduction-to-session-types/) + diff --git a/documentation/bookmark/css.md b/documentation/bookmark/css.md index b5dc09f3f..7492be4ab 100644 --- a/documentation/bookmark/css.md +++ b/documentation/bookmark/css.md @@ -4,6 +4,7 @@ # Reference +0. [Got Spaghetti Stylesheets? 4 Techniques for Managing CSS Complexity](https://blog.shimin.io/4-techniques-for-managing-css-complexity/) 0. [Why is :hover:after valid but not :after:hover? CSS Pseudo-Class and Pseudo-Element Selectors](https://blog.shimin.io/pseudo-class-and-pseudo-element-selectors/) 0. [Increasing the performance of elm-css](https://blogg.bekk.no/increasing-the-performance-of-elm-css-34075512d6a6) 0. [The Case for Atomic / Utility-First CSS](https://johnpolacek.github.io/the-case-for-atomic-css/) diff --git a/documentation/bookmark/data_structure.md b/documentation/bookmark/data/structure.md index ebf7070e2..ebf7070e2 100644 --- a/documentation/bookmark/data_structure.md +++ b/documentation/bookmark/data/structure.md diff --git a/documentation/bookmark/data/structure/bitmap.md b/documentation/bookmark/data/structure/bitmap.md new file mode 100644 index 000000000..d7a494752 --- /dev/null +++ b/documentation/bookmark/data/structure/bitmap.md @@ -0,0 +1,4 @@ +# Reference + +0. [Roaring Bitmaps](https://roaringbitmap.org/) + diff --git a/documentation/bookmark/documentation.md b/documentation/bookmark/documentation.md index 405bee172..dec25e3d9 100644 --- a/documentation/bookmark/documentation.md +++ b/documentation/bookmark/documentation.md @@ -31,6 +31,7 @@ # Philosophy +0. [Documentation as practical empathy](https://developerrelations.com/developer-experience/documentation-as-practical-empathy) 0. [What Makes Documentation Bad?](https://arunkprasad.com/log/what-makes-documentation-bad/) 0. [Forget reusability, aim for perfection](https://www.openbsd.org/papers/bsdcan18-mandoc.pdf) 0. https://increment.com/documentation/ @@ -55,6 +56,7 @@ # Reference +0. [Building a community of open-source documentation contributors](https://news.ycombinator.com/newest?next=31705868&n=1171) 0. [Documentation in the Era of Concepts and Ranges - Christopher Di Bella & Sy Brand - CppCon 2021](https://www.youtube.com/watch?v=nm45t2fnUms) 0. [conventional: comments](https://conventionalcomments.org/) 0. [Architecture decision record (ADR)](https://github.com/joelparkerhenderson/architecture_decision_record) diff --git a/documentation/bookmark/food.md b/documentation/bookmark/food.md new file mode 100644 index 000000000..d23173ebc --- /dev/null +++ b/documentation/bookmark/food.md @@ -0,0 +1,4 @@ +# Reference + +0. [Squareat](https://squareat.com/) + diff --git a/documentation/bookmark/law.md b/documentation/bookmark/law.md index 20f99340d..06c479ac7 100644 --- a/documentation/bookmark/law.md +++ b/documentation/bookmark/law.md @@ -1,5 +1,6 @@ # Reference +0. [Text Prudent](https://textprudent.com/) 0. [Reviewers Edition](https://reviewersedition.org/) 0. [Legal Versioning: refined scheme for functional prose projects](https://writing.kemitchell.com/2022/05/28/Legal-Versioning) 0. [Legal Versioning](https://legalversioning.com/) diff --git a/documentation/bookmark/linear_programming.md b/documentation/bookmark/linear_programming.md new file mode 100644 index 000000000..c6706d0ab --- /dev/null +++ b/documentation/bookmark/linear_programming.md @@ -0,0 +1,6 @@ +# Reference + +0. [Introduction to Linear Programming in Python: A guide to mathematical optimization with Google OR-Tools](https://mlabonne.github.io/blog/linearoptimization/) + 0. [Integer vs. Linear Programming in Python: Mixed Integer Programming for optimization with Google OR-Tools](https://mlabonne.github.io/blog/integerprogramming/) + 0. [Introduction to Constraint Programming in Python: The Programming Paradigm to Find One Solution Among 8,080,104 Candidates](https://mlabonne.github.io/blog/constraintprogramming/) + diff --git a/documentation/bookmark/memory_management/garbage_collection.md b/documentation/bookmark/memory_management/garbage_collection.md index 9f938dcb1..2652cc2a0 100644 --- a/documentation/bookmark/memory_management/garbage_collection.md +++ b/documentation/bookmark/memory_management/garbage_collection.md @@ -1,4 +1,5 @@ # Reference +0. [Distilling the Real Cost of Production Garbage Collectors](https://users.cecs.anu.edu.au/~steveb/pubs/papers/lbo-ispass-2022.pdf) 0. [Summarizing Garbage Collection](https://eschew.wordpress.com/2016/09/02/summarizing-gc/) diff --git a/documentation/bookmark/open_source.md b/documentation/bookmark/open_source.md index 467a54662..f92461f6e 100644 --- a/documentation/bookmark/open_source.md +++ b/documentation/bookmark/open_source.md @@ -1,4 +1,6 @@ # Reference -1. [Why Modern Open Source Projects Fail](https://arxiv.org/abs/1707.02327) +0. [Open Source Guides](https://opensource.guide/) +0. [Uncurled - everything I know and learned about running and maintaining Open Source projects for three decades.](https://un.curl.dev/) +0. [Why Modern Open Source Projects Fail](https://arxiv.org/abs/1707.02327) diff --git a/documentation/bookmark/operating_system/timer.md b/documentation/bookmark/operating_system/timer.md new file mode 100644 index 000000000..5cf2252b8 --- /dev/null +++ b/documentation/bookmark/operating_system/timer.md @@ -0,0 +1,4 @@ +# Reference + +0. [Hashed and Hierarchical Timing Wheels: Data Structures for the Efficient Implementation of a Timer Facility](http://www.cs.columbia.edu/~nahum/w6998/papers/sosp87-timing-wheels.pdf) + diff --git a/documentation/bookmark/polymorphism/rank.md b/documentation/bookmark/polymorphism/rank.md new file mode 100644 index 000000000..9ef399f91 --- /dev/null +++ b/documentation/bookmark/polymorphism/rank.md @@ -0,0 +1,4 @@ +# Reference + +0. [The Semantics of Rank Polymorphism](https://arxiv.org/abs/1907.00509) + diff --git a/documentation/bookmark/security/authentication.md b/documentation/bookmark/security/authentication.md index 21c8c5bbd..96284cf57 100644 --- a/documentation/bookmark/security/authentication.md +++ b/documentation/bookmark/security/authentication.md @@ -1,5 +1,6 @@ # Reference +0. [The future of authentication is both stateful and stateless](https://clerk.dev/blog/future-of-auth-stateless-and-stateful) 0. [Move beyond passwords](https://developer.apple.com/videos/play/wwdc2021/10106/) 0. [WebAuthn.io](https://webauthn.io/) diff --git a/documentation/bookmark/telephony.md b/documentation/bookmark/telephony.md new file mode 100644 index 000000000..e89b7cafd --- /dev/null +++ b/documentation/bookmark/telephony.md @@ -0,0 +1,4 @@ +# Reference + +0. [Fonoster: The open-source alternative to Twilio](https://github.com/fonoster/fonoster) + diff --git a/documentation/bookmark/tool/text_editor.md b/documentation/bookmark/tool/text_editor.md index ca8a73b8a..b2b0c7d54 100644 --- a/documentation/bookmark/tool/text_editor.md +++ b/documentation/bookmark/tool/text_editor.md @@ -67,7 +67,6 @@ 0. [Deft for Emacs](https://jblevins.org/projects/deft/) 0. [Text Editing Hates You Too](https://lord.io/text-editing-hates-you-too/) -0. [Build Your Own Text Editor](https://viewsourcecode.org/snaptoken/kilo/index.html) 0. [On the design of text editors](https://arxiv.org/abs/2008.06030) 0. [The Piece Table - the Unsung Hero of Your Text Editor](https://darrenburns.net/posts/piece-table/) 0. [Build Your Own Text Editor](https://viewsourcecode.org/snaptoken/kilo/) diff --git a/documentation/bookmark/type_theory/union_and_intersection.md b/documentation/bookmark/type_theory/union_and_intersection.md new file mode 100644 index 000000000..3f053f60b --- /dev/null +++ b/documentation/bookmark/type_theory/union_and_intersection.md @@ -0,0 +1,5 @@ +# Reference + +0. [Union and intersection contracts are hard, actually](https://www.tweag.io/blog/2022-04-28-union-intersection-contracts/) + 0. [Union and intersection contracts are hard, actually](https://arxiv.org/abs/2106.06278) + diff --git a/documentation/bookmark/user_interface/animation.md b/documentation/bookmark/user_interface/animation.md new file mode 100644 index 000000000..97fa415c0 --- /dev/null +++ b/documentation/bookmark/user_interface/animation.md @@ -0,0 +1,4 @@ +# Reference + +0. https://easings.net/ + diff --git a/documentation/bookmark/user_interface/paradigm/flow.md b/documentation/bookmark/user_interface/paradigm/flow.md new file mode 100644 index 000000000..98c4644f1 --- /dev/null +++ b/documentation/bookmark/user_interface/paradigm/flow.md @@ -0,0 +1,4 @@ +# Reference + +0. [Flows: A New Approach to UI Development](http://jasonhpriestley.com/flows) + diff --git a/documentation/bookmark/user_interface/terminal.md b/documentation/bookmark/user_interface/terminal.md index 15a6adf32..3040ebf5a 100644 --- a/documentation/bookmark/user_interface/terminal.md +++ b/documentation/bookmark/user_interface/terminal.md @@ -1,4 +1,5 @@ # Reference +0. [Command Line Interface Guidelines](https://clig.dev/) 0. [Textualize](https://www.textualize.io/) diff --git a/documentation/bookmark/video/codec.md b/documentation/bookmark/video/codec.md new file mode 100644 index 000000000..ae0156b9d --- /dev/null +++ b/documentation/bookmark/video/codec.md @@ -0,0 +1,4 @@ +# Reference + +0. [NotchLC](https://notchlc.notch.one/) + diff --git a/documentation/bookmark/video/visual_effects.md b/documentation/bookmark/video/visual_effects.md new file mode 100644 index 000000000..8ef5736f7 --- /dev/null +++ b/documentation/bookmark/video/visual_effects.md @@ -0,0 +1,4 @@ +# Reference + +0. [Notch](https://www.notch.one/) + diff --git a/documentation/bookmark/workflow.md b/documentation/bookmark/workflow.md new file mode 100644 index 000000000..d3df0cccc --- /dev/null +++ b/documentation/bookmark/workflow.md @@ -0,0 +1,4 @@ +# Reference + +0. [Common Workflow Language](https://www.commonwl.org/) + diff --git a/lux-python/source/program.lux b/lux-python/source/program.lux index 1bdc743c0..2704b0e80 100644 --- a/lux-python/source/program.lux +++ b/lux-python/source/program.lux @@ -307,7 +307,10 @@ [(java/lang/Class java/lang/Object) ..object_class java/lang/Object (as java/lang/Object it)] ... Methods - (LuxValue [] (value self []) java/lang/Object (as java/lang/Object it)) + (LuxValue + [] (value self []) + java/lang/Object + (as java/lang/Object it)) (org/python/core/PyArray [] (pyget self [index' int]) @@ -316,7 +319,7 @@ (as (Array Any)) (array.item (|> index' ffi.int_to_long (as Nat)))) {.#None} - (::super! [index']) + (pyget "super" [index']) {.#Some it} (<| (case (ffi.as [java/lang/Object] (as java/lang/Object it)) @@ -329,7 +332,7 @@ (pseudo_function to_host it) {.#None}) - (::super! [index'])))) + (pyget "super" [index'])))) ))) (def: (to_host it) diff --git a/stdlib/source/library/lux/control/concurrency/actor.lux b/stdlib/source/library/lux/control/concurrency/actor.lux index 38ecbdce2..55534dfab 100644 --- a/stdlib/source/library/lux/control/concurrency/actor.lux +++ b/stdlib/source/library/lux/control/concurrency/actor.lux @@ -1,39 +1,23 @@ (.using [library [lux (.except) - ["[0]" debug] [abstract [monad (.only do)]] [control ["[0]" pipe] - ["[0]" function] ["[0]" try (.only Try)] ["[0]" exception (.only exception:)] - ["[0]" io (.only IO io)] - ["<>" parser (.open: "[1]#[0]" monad) - ["<[0]>" code (.only Parser)]]] + ["[0]" io (.only IO io)]] [data ["[0]" bit] - ["[0]" product] - [text - ["%" \\format (.only format)]] - [collection - ["[0]" list (.open: "[1]#[0]" monoid monad)]]] - ["[0]" macro (.only with_symbols) - ["[0]" code] - ["[0]" local] - [syntax (.only syntax) - ["|[0]|" input] - ["|[0]|" export]]] - [math - [number - ["n" nat]]] - ["[0]" meta (.only monad)] + ["[0]" product]] + [macro + ["[0]" local]] [type (.only sharing) - ["[0]" primitive (.only primitive: representation abstraction)]]]] + [primitive (.only primitive: representation abstraction)]]]] [// ["[0]" atom (.only Atom atom)] - ["[0]" async (.only Async Resolver) (.open: "[1]#[0]" monad)] + ["[0]" async (.only Async Resolver)] ["[0]" frp (.only Channel Channel')]]) (exception: .public poisoned) diff --git a/stdlib/source/library/lux/control/parser.lux b/stdlib/source/library/lux/control/parser.lux index afd8c4802..fef41832d 100644 --- a/stdlib/source/library/lux/control/parser.lux +++ b/stdlib/source/library/lux/control/parser.lux @@ -25,11 +25,11 @@ (def: (each f ma) (function (_ input) (case (ma input) - {try.#Failure msg} - {try.#Failure msg} - {try.#Success [input' a]} - {try.#Success [input' (f a)]}))))) + {try.#Success [input' (f a)]} + + {try.#Failure msg} + {try.#Failure msg}))))) (def: .public apply (All (_ s) (Apply (Parser s))) @@ -62,11 +62,11 @@ (def: (conjoint mma) (function (_ input) (case (mma input) - {try.#Failure msg} - {try.#Failure msg} - {try.#Success [input' ma]} - (ma input')))))) + (ma input') + + {try.#Failure msg} + {try.#Failure msg}))))) (def: .public (assertion message test) (All (_ s) (-> Text Bit (Parser s Any))) @@ -80,11 +80,11 @@ (-> (Parser s a) (Parser s (Maybe a)))) (function (_ input) (case (parser input) - {try.#Failure _} - {try.#Success [input {.#None}]} - {try.#Success [input' x]} - {try.#Success [input' {.#Some x}]}))) + {try.#Success [input' {.#Some x}]} + + {try.#Failure _} + {try.#Success [input {.#None}]}))) (def: .public (result parser input) (All (_ s a) @@ -130,13 +130,13 @@ (-> (Parser s a) (Parser s (List a)))) (function (_ input) (case (parser input) - {try.#Failure _} - {try.#Success [input (list)]} - {try.#Success [input' head]} (..result (at ..monad each (|>> (list.partial head)) (some parser)) - input')))) + input') + + {try.#Failure _} + {try.#Success [input (list)]}))) (def: .public (many parser) (All (_ s a) @@ -167,13 +167,13 @@ 0 (at ..monad in (list)) _ (function (_ input) (case (parser input) - {try.#Failure msg} - {try.#Success [input (list)]} - {try.#Success [input' x]} (..result (at ..monad each (|>> {.#Item x}) (at_most (-- amount) parser)) - input'))))) + input') + + {try.#Failure msg} + {try.#Success [input (list)]})))) (def: .public (between minimum additional parser) (All (_ s a) (-> Nat Nat (Parser s a) (Parser s (List a)))) @@ -189,14 +189,14 @@ (do [! ..monad] [?x (..maybe parser)] (case ?x - {.#None} - (in {.#End}) - {.#Some x} (|> parser (..and separator) ..some - (at ! each (|>> (list#each product.right) {.#Item x})))))) + (at ! each (|>> (list#each product.right) {.#Item x}))) + + {.#None} + (in {.#End})))) (def: .public (not parser) (All (_ s a) (-> (Parser s a) (Parser s Any))) @@ -227,11 +227,11 @@ (All (_ s a) (-> a (Parser s a) (Parser s a))) (function (_ input) (case (parser input) - {try.#Failure error} - {try.#Success [input value]} - {try.#Success [input' output]} - {try.#Success [input' output]}))) + {try.#Success [input' output]} + + {try.#Failure error} + {try.#Success [input value]}))) (def: .public remaining (All (_ s) (Parser s s)) @@ -267,21 +267,21 @@ (All (_ s a) (-> (Parser s a) (Parser s Bit))) (function (_ input) (case (parser input) - {try.#Failure error} - {try.#Success [input false]} - {try.#Success [input' _]} - {try.#Success [input' true]}))) + {try.#Success [input' true]} + + {try.#Failure error} + {try.#Success [input false]}))) (def: .public (parses parser) (All (_ s a) (-> (Parser s a) (Parser s Any))) (function (_ input) (case (parser input) - {try.#Failure error} - {try.#Failure error} - {try.#Success [input' _]} - {try.#Success [input' []]}))) + {try.#Success [input' []]} + + {try.#Failure error} + {try.#Failure error}))) (def: .public (speculative parser) (All (_ s a) (-> (Parser s a) (Parser s a))) @@ -290,20 +290,20 @@ {try.#Success [input' output]} {try.#Success [input output]} - output - output))) + failure + failure))) (def: .public (codec codec parser) (All (_ s a z) (-> (Codec a z) (Parser s a) (Parser s z))) (function (_ input) (case (parser input) - {try.#Failure error} - {try.#Failure error} - {try.#Success [input' to_decode]} (case (at codec decoded to_decode) - {try.#Failure error} - {try.#Failure error} - {try.#Success value} - {try.#Success [input' value]})))) + {try.#Success [input' value]} + + {try.#Failure error} + {try.#Failure error}) + + {try.#Failure error} + {try.#Failure error}))) diff --git a/stdlib/source/library/lux/ffi.jvm.lux b/stdlib/source/library/lux/ffi.jvm.lux index 7d9a5bb2c..4753e6f14 100644 --- a/stdlib/source/library/lux/ffi.jvm.lux +++ b/stdlib/source/library/lux/ffi.jvm.lux @@ -1,7 +1,7 @@ (.using [library [lux (.except Primitive Type type int char is as) - ["[0]" meta] + ["[0]" meta (.open: "[1]#[0]" monad)] [abstract ["[0]" monad (.only do)]] [control @@ -23,7 +23,8 @@ [syntax (.only syntax)] ["^" pattern] ["[0]" code] - ["[0]" template]] + ["[0]" template] + ["[0]" local]] [target ["[0]" jvm [encoding @@ -1088,106 +1089,110 @@ (-> (Typed Code) Code) (` [(~ (value$ class)) (~ term)])) +(def: (overriden_method_macro super_class name declaration type_vars self_name expected_arguments) + (-> (Type Class) Text (Type Declaration) (List (Type Var)) Text (List Argument) Macro) + (syntax (_ [_ (<code>.this (' "super")) + actual_arguments (<code>.tuple (<>.exactly (list.size expected_arguments) <code>.any))]) + (in (list (` ("jvm member invoke special" + [(~+ (list#each (|>> ..signature code.text) (product.right (parser.declaration declaration))))] + (~ (code.text (product.left (parser.read_class super_class)))) + (~ (code.text name)) + [(~+ (list#each (|>> ..signature code.text) type_vars))] + ("jvm object cast" (~ (code.local self_name))) + (~+ (|> actual_arguments + (list#each (|>> ~ "jvm object cast" `)) + (list.zipped_2 (list#each product.right expected_arguments)) + (list#each ..decorate_input))))))))) + (def: (method_def$ fully_qualified_class_name method_parser super_class fields [[name pm anns] method_def]) - (-> External (Parser Code) (Type Class) (List [Member_Declaration FieldDecl]) [Member_Declaration Method_Definition] Code) + (-> External (Parser Code) (Type Class) (List [Member_Declaration FieldDecl]) [Member_Declaration Method_Definition] (Meta Code)) (case method_def {#ConstructorMethod strict_fp? type_vars self_name arguments constructor_args body exs} (let [replacer (|> (list#each (field->parser fully_qualified_class_name self_name) fields) (list#mix <>.either method_parser) parser->replacer)] - (` ("init" - (~ (privacy_modifier$ pm)) - (~ (code.bit strict_fp?)) - [(~+ (list#each annotation$ anns))] - [(~+ (list#each var$ type_vars))] - [(~+ (list#each class$ exs))] - (~ (code.text self_name)) - [(~+ (list#each argument$ arguments))] - [(~+ (list#each constructor_arg$ constructor_args))] - (~ (replaced replacer body)) - ))) + (meta#in (` ("init" + (~ (privacy_modifier$ pm)) + (~ (code.bit strict_fp?)) + [(~+ (list#each annotation$ anns))] + [(~+ (list#each var$ type_vars))] + [(~+ (list#each class$ exs))] + (~ (code.text self_name)) + [(~+ (list#each argument$ arguments))] + [(~+ (list#each constructor_arg$ constructor_args))] + (~ (replaced replacer body)) + )))) {#VirtualMethod final? strict_fp? type_vars self_name arguments return_type body exs} (let [replacer (|> (list#each (field->parser fully_qualified_class_name self_name) fields) (list#mix <>.either method_parser) parser->replacer)] - (` ("virtual" - (~ (code.text name)) - (~ (privacy_modifier$ pm)) - (~ (code.bit final?)) - (~ (code.bit strict_fp?)) - [(~+ (list#each annotation$ anns))] - [(~+ (list#each var$ type_vars))] - (~ (code.text self_name)) - [(~+ (list#each argument$ arguments))] - (~ (return$ return_type)) - [(~+ (list#each class$ exs))] - (~ (replaced replacer body))))) + (meta#in (` ("virtual" + (~ (code.text name)) + (~ (privacy_modifier$ pm)) + (~ (code.bit final?)) + (~ (code.bit strict_fp?)) + [(~+ (list#each annotation$ anns))] + [(~+ (list#each var$ type_vars))] + (~ (code.text self_name)) + [(~+ (list#each argument$ arguments))] + (~ (return$ return_type)) + [(~+ (list#each class$ exs))] + (~ (replaced replacer body)))))) - {#OverridenMethod strict_fp? declaration type_vars self_name arguments return_type body exs} + {#OverridenMethod strict_fp? declaration type_vars self_name expected_arguments return_type body exs} (let [replacer (|> (list#each (field->parser fully_qualified_class_name self_name) fields) (list#mix <>.either method_parser) - parser->replacer) - super_replacer (parser->replacer (<code>.form (do <>.monad - [_ (<code>.this (' ::super!)) - args (<code>.tuple (<>.exactly (list.size arguments) <code>.any))] - (in (` ("jvm member invoke special" - [(~+ (list#each (|>> ..signature code.text) (product.right (parser.declaration declaration))))] - (~ (code.text (product.left (parser.read_class super_class)))) - (~ (code.text name)) - [(~+ (list#each (|>> ..signature code.text) type_vars))] - ("jvm object cast" (~ (code.local self_name))) - (~+ (|> args - (list#each (|>> ~ "jvm object cast" `)) - (list.zipped_2 (list#each product.right arguments)) - (list#each ..decorate_input)))))))))] - (` ("override" - (~ (declaration$ declaration)) - (~ (code.text name)) - (~ (code.bit strict_fp?)) - [(~+ (list#each annotation$ anns))] - [(~+ (list#each var$ type_vars))] - (~ (code.text self_name)) - [(~+ (list#each argument$ arguments))] - (~ (return$ return_type)) - [(~+ (list#each class$ exs))] - (~ (|> body - (replaced replacer) - (replaced super_replacer))) - ))) + parser->replacer)] + (do meta.monad + [@ meta.current_module_name + body/+ (local.with (list [[@ name] (overriden_method_macro super_class name declaration type_vars self_name expected_arguments)]) + #1 + body)] + (in (` ("override" + (~ (declaration$ declaration)) + (~ (code.text name)) + (~ (code.bit strict_fp?)) + [(~+ (list#each annotation$ anns))] + [(~+ (list#each var$ type_vars))] + (~ (code.text self_name)) + [(~+ (list#each argument$ expected_arguments))] + (~ (return$ return_type)) + [(~+ (list#each class$ exs))] + (~+ (list#each (replaced replacer) body/+))))))) {#StaticMethod strict_fp? type_vars arguments return_type body exs} (let [replacer (parser->replacer (<>.failure ""))] - (` ("static" - (~ (code.text name)) - (~ (privacy_modifier$ pm)) - (~ (code.bit strict_fp?)) - [(~+ (list#each annotation$ anns))] - [(~+ (list#each var$ type_vars))] - [(~+ (list#each argument$ arguments))] - (~ (return$ return_type)) - [(~+ (list#each class$ exs))] - (~ (replaced replacer body))))) + (meta#in (` ("static" + (~ (code.text name)) + (~ (privacy_modifier$ pm)) + (~ (code.bit strict_fp?)) + [(~+ (list#each annotation$ anns))] + [(~+ (list#each var$ type_vars))] + [(~+ (list#each argument$ arguments))] + (~ (return$ return_type)) + [(~+ (list#each class$ exs))] + (~ (replaced replacer body)))))) {#AbstractMethod type_vars arguments return_type exs} - (` ("abstract" - (~ (code.text name)) - (~ (privacy_modifier$ pm)) - [(~+ (list#each annotation$ anns))] - [(~+ (list#each var$ type_vars))] - [(~+ (list#each argument$ arguments))] - (~ (return$ return_type)) - [(~+ (list#each class$ exs))])) + (meta#in (` ("abstract" + (~ (code.text name)) + (~ (privacy_modifier$ pm)) + [(~+ (list#each annotation$ anns))] + [(~+ (list#each var$ type_vars))] + [(~+ (list#each argument$ arguments))] + (~ (return$ return_type)) + [(~+ (list#each class$ exs))]))) {#NativeMethod type_vars arguments return_type exs} - (` ("native" - (~ (code.text name)) - (~ (privacy_modifier$ pm)) - [(~+ (list#each annotation$ anns))] - [(~+ (list#each var$ type_vars))] - [(~+ (list#each class$ exs))] - [(~+ (list#each argument$ arguments))] - (~ (return$ return_type)))) + (meta#in (` ("native" + (~ (code.text name)) + (~ (privacy_modifier$ pm)) + [(~+ (list#each annotation$ anns))] + [(~+ (list#each var$ type_vars))] + [(~+ (list#each class$ exs))] + [(~+ (list#each argument$ arguments))] + (~ (return$ return_type))))) )) (def: (complete_call$ g!obj [method args]) @@ -1214,7 +1219,8 @@ method_parser (.is (Parser Code) (|> methods (list#each (method->parser class_vars fully_qualified_class_name)) - (list#mix <>.either (<>.failure ""))))]] + (list#mix <>.either (<>.failure ""))))] + methods (monad.each ! (method_def$ fully_qualified_class_name method_parser super fields) methods)] (in (list (` ("jvm class" (~ (declaration$ (jvm.declaration full_class_name class_vars))) (~ (class$ super)) @@ -1222,7 +1228,7 @@ (~ (inheritance_modifier$ im)) [(~+ (list#each annotation$ annotations))] [(~+ (list#each field_decl$ fields))] - [(~+ (list#each (method_def$ fully_qualified_class_name method_parser super fields) methods))]))))))) + [(~+ methods)]))))))) (def: .public interface: (syntax (_ [.let [! <>.monad] @@ -1245,12 +1251,14 @@ (<code>.tuple (<>.some (class^ class_vars)))) constructor_args (..constructor_args^ class_vars) methods (<>.some ..overriden_method_def^)]) - (in (list (` ("jvm class anonymous" - [(~+ (list#each var$ class_vars))] - (~ (class$ super)) - [(~+ (list#each class$ interfaces))] - [(~+ (list#each constructor_arg$ constructor_args))] - [(~+ (list#each (method_def$ "" (<>.failure "") super (list)) methods))])))))) + (do [! meta.monad] + [methods (monad.each ! (method_def$ "" (<>.failure "") super (list)) methods)] + (in (list (` ("jvm class anonymous" + [(~+ (list#each var$ class_vars))] + (~ (class$ super)) + [(~+ (list#each class$ interfaces))] + [(~+ (list#each constructor_arg$ constructor_args))] + [(~+ methods)]))))))) (def: .public null (syntax (_ []) diff --git a/stdlib/source/library/lux/macro/local.lux b/stdlib/source/library/lux/macro/local.lux index 5a07b4a48..2d93ea1fc 100644 --- a/stdlib/source/library/lux/macro/local.lux +++ b/stdlib/source/library/lux/macro/local.lux @@ -110,18 +110,10 @@ (..push_one [g!pop (..pop_all (list#each product.left macros) g!pop)]))] (in (` ((~ g!pop)))))) -(def: .public (with macros body) - (-> (List [Symbol Macro]) Code (Meta (List Code))) +(def: .public (with macros expression? body) + (-> (List [Symbol Macro]) Bit Code (Meta (List Code))) (do [! meta.monad] - [expression? (is (Meta Bit) - (function (_ lux) - {try.#Success [lux (case (the .#expected lux) - {.#None} - false - - {.#Some _} - true)]})) - g!pop (..push macros)] + [g!pop (..push macros)] (.if expression? (//.with_symbols [g!body] (in (list (` (.let [(~ g!body) (~ body)] @@ -141,5 +133,13 @@ (meta.eval .Macro) (at ! each (|>> (as .Macro) [[here_name name]])))) - locals)] - (..with locals body)))) + locals) + expression? (is (Meta Bit) + (function (_ lux) + {try.#Success [lux (case (the .#expected lux) + {.#None} + false + + {.#Some _} + true)]}))] + (..with locals expression? body)))) 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 bb307180d..e285ff15a 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 @@ -14,7 +14,8 @@ ["<>" parser (.only) ["<[0]>" code (.only Parser)]]] [data - [binary (.only Binary)] + [binary (.only Binary) + ["[0]" \\format]] ["[0]" product] ["[0]" text (.open: "[1]#[0]" equivalence) ["%" \\format (.only format)] @@ -23,9 +24,7 @@ ["[0]" list (.open: "[1]#[0]" mix monad monoid)] ["[0]" array] ["[0]" dictionary (.only Dictionary)] - ["[0]" sequence]] - ["[0]" format - ["[1]" binary]]] + ["[0]" sequence]]] [macro ["^" pattern] ["[0]" template]] @@ -79,6 +78,8 @@ ["[0]" scope]] [/// ["[0]" phase (.open: "[1]#[0]" monad)] + ["[0]" reference (.only) + ["[0]" variable]] [meta [archive (.only Archive) [module @@ -2235,6 +2236,74 @@ (/////analysis.tuple (list forced_refencing bodyA))] (list)]})))) +(def: (with_fake_parameter#pattern it) + (-> pattern.Pattern pattern.Pattern) + (case it + {pattern.#Simple _} + it + + {pattern.#Complex it} + {pattern.#Complex + (case it + {complex.#Variant it} + {complex.#Variant (revised complex.#value with_fake_parameter#pattern it)} + + {complex.#Tuple it} + {complex.#Tuple (list#each with_fake_parameter#pattern it)})} + + {pattern.#Bind it} + {pattern.#Bind (++ it)})) + +(def: (with_fake_parameter it) + (-> Analysis Analysis) + (case it + {/////analysis.#Simple _} + it + + {/////analysis.#Structure it} + {/////analysis.#Structure + (case it + {complex.#Variant it} + {complex.#Variant (revised complex.#value with_fake_parameter it)} + + {complex.#Tuple it} + {complex.#Tuple (list#each with_fake_parameter it)})} + + {/////analysis.#Reference it} + {/////analysis.#Reference + (case it + {reference.#Variable it} + {reference.#Variable + (case it + {variable.#Local it} + {variable.#Local (++ it)} + + {variable.#Foreign _} + it)} + + {reference.#Constant _} + it)} + + {/////analysis.#Case value [head tail]} + {/////analysis.#Case (with_fake_parameter value) + (let [with_fake_parameter (is (-> /////analysis.Branch /////analysis.Branch) + (|>> (revised /////analysis.#when with_fake_parameter#pattern) + (revised /////analysis.#then with_fake_parameter)))] + [(with_fake_parameter head) + (list#each with_fake_parameter tail)])} + + {/////analysis.#Function environment body} + {/////analysis.#Function (list#each with_fake_parameter environment) + body} + + {/////analysis.#Apply parameter abstraction} + {/////analysis.#Apply (with_fake_parameter parameter) + (with_fake_parameter abstraction)} + + {/////analysis.#Extension name parameters} + {/////analysis.#Extension name + (list#each with_fake_parameter parameters)})) + (def: .public (analyse_overriden_method analyse archive selfT mapping supers method) (-> Phase Archive .Type Mapping (List (Type Class)) (Overriden_Method Code) (Operation Analysis)) (let [[parent_type method_name @@ -2265,7 +2334,8 @@ list.reversed (list#mix scope.with_local (analyse archive body)) (typeA.expecting :return:) - scope.with)] + scope.with) + .let [arity (list.size arguments)]] (in (/////analysis.tuple (list (/////analysis.text ..overriden_tag) (class_analysis parent_type) (/////analysis.text method_name) @@ -2280,7 +2350,10 @@ {/////analysis.#Function (list#each (|>> /////analysis.variable) (scope.environment scope)) - (..hidden_method_body (list.size arguments) bodyA)} + (<| (..hidden_method_body arity) + (case arity + 0 (with_fake_parameter bodyA) + _ bodyA))} )))))) (def: (matched? [sub sub_method subJT] [super super_method superJT]) @@ -2394,7 +2467,7 @@ (let [signature (signature.inheritance (list#each jvm.signature parameters) (jvm.signature super) (list#each jvm.signature interfaces))] - (try#each (|>> (format.result class.writer) + (try#each (|>> (\\format.result class.writer) [name]) (class.class version.v6_0 (all modifier#composite 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 9198eff46..957b2339d 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 @@ -12,8 +12,9 @@ ["<[0]>" code (.only Parser)] ["<[0]>" synthesis]]] [data - [binary (.only Binary)] ["[0]" product] + [binary (.only Binary) + ["[0]" \\format]] ["[0]" text ["%" \\format (.only format)] ["<[1]>" \\parser]] @@ -21,9 +22,7 @@ ["[0]" list (.open: "[1]#[0]" functor mix)] ["[0]" dictionary] ["[0]" sequence] - ["[0]" set (.only Set)]] - ["[0]" format - ["[1]" binary]]] + ["[0]" set (.only Set)]]] [macro ["^" pattern] ["[0]" template]] @@ -331,7 +330,7 @@ (<synthesis>.tuple (<>.some ..annotation_synthesis)) (<synthesis>.tuple (<>.some ..var_type_synthesis)) <synthesis>.text - (do <>.monad + (do [! <>.monad] [args (<synthesis>.tuple (<>.some ..argument_synthesis))] (all <>.and (in args) @@ -533,7 +532,10 @@ (do [! phase.monad] [.let [[super method_name strict_floating_point? annotations method_tvars self arguments returnJ exceptionsJ - bodyS] method] + bodyS] method + bodyS (case (list.size arguments) + 0 (host.without_fake_parameter bodyS) + _ bodyS)] generate directive.generation] (directive.lifted_generation (do ! @@ -684,7 +686,7 @@ (let [signature (signature.inheritance (list#each type.signature parameters) (type.signature super) (list#each type.signature interfaces))] - (try#each (|>> (format.result class.writer) + (try#each (|>> (\\format.result class.writer) [name]) (class.class version.v6_0 (all modifier#composite @@ -901,7 +903,7 @@ (the [directive.#generation directive.#phase] state)]) methods) .let [all_dependencies (cache.all (list#each product.left methods))] - bytecode (<| (at ! each (format.result class.writer)) + bytecode (<| (at ! each (\\format.result class.writer)) phase.lifted (class.class version.v6_0 (all modifier#composite @@ -940,7 +942,7 @@ (function (_ extension_name phase archive [[name parameters] supers annotations method_declarations]) (directive.lifted_generation (do [! phase.monad] - [bytecode (<| (at ! each (format.result class.writer)) + [bytecode (<| (at ! each (\\format.result class.writer)) phase.lifted (class.class version.v6_0 (all modifier#composite diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/host.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/host.lux index 6f5057d00..30ef58a77 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/host.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/host.lux @@ -10,6 +10,8 @@ ["<[0]>" synthesis (.only Parser)]]] [data ["[0]" product] + [binary + ["[0]" \\format]] ["[0]" text (.open: "[1]#[0]" equivalence) ["%" \\format] ["<[1]>" \\parser]] @@ -17,9 +19,7 @@ ["[0]" list (.open: "[1]#[0]" monad mix monoid)] ["[0]" dictionary (.only Dictionary)] ["[0]" set (.only Set)] - ["[0]" sequence]] - ["[0]" format - ["[1]" binary]]] + ["[0]" sequence]]] [macro ["^" pattern] ["[0]" template]] @@ -64,9 +64,10 @@ [analysis ["/" jvm]]] ["/[1]" // - [analysis (.only Environment)] ["[1][0]" synthesis (.only Synthesis Path %synthesis)] ["[1][0]" generation] + [analysis (.only Environment) + ["[0]" complex]] [/// ["[1]" phase] ["[1][0]" reference (.only) @@ -846,6 +847,129 @@ _ <oops>))) +(def: (without_fake_parameter#path without_fake_parameter) + (-> (-> Synthesis Synthesis) + (-> Path Path)) + (function (again it) + (case it + (^.or {//////synthesis.#Pop} + {//////synthesis.#Access _}) + it + + {//////synthesis.#Bind it} + {//////synthesis.#Bind (-- it)} + + {//////synthesis.#Bit_Fork when then else} + {//////synthesis.#Bit_Fork when + (again then) + (maybe#each again else)} + + (^.with_template [<tag>] + [{<tag> [head tail]} + {<tag> [(revised //////synthesis.#then again head) + (list#each (revised //////synthesis.#then again) tail)]}]) + ([//////synthesis.#I64_Fork] + [//////synthesis.#F64_Fork] + [//////synthesis.#Text_Fork]) + + (^.with_template [<tag>] + [{<tag> left right} + {<tag> (again left) (again right)}]) + ([//////synthesis.#Seq] + [//////synthesis.#Alt]) + + {//////synthesis.#Then it} + {//////synthesis.#Then (without_fake_parameter it)}))) + +(def: .public (without_fake_parameter it) + (-> Synthesis Synthesis) + (case it + {//////synthesis.#Simple _} + it + + {//////synthesis.#Structure it} + {//////synthesis.#Structure + (case it + {complex.#Variant it} + {complex.#Variant (revised complex.#value without_fake_parameter it)} + + {complex.#Tuple it} + {complex.#Tuple (list#each without_fake_parameter it)})} + + {//////synthesis.#Reference it} + {//////synthesis.#Reference + (case it + {//////reference.#Variable it} + {//////reference.#Variable + (case it + {//////variable.#Local it} + {//////variable.#Local (-- it)} + + {//////variable.#Foreign _} + it)} + + {//////reference.#Constant _} + it)} + + {//////synthesis.#Control it} + {//////synthesis.#Control + (case it + {//////synthesis.#Branch it} + {//////synthesis.#Branch + (case it + {//////synthesis.#Exec before after} + {//////synthesis.#Exec (without_fake_parameter before) + (without_fake_parameter after)} + + {//////synthesis.#Let value register body} + {//////synthesis.#Let (without_fake_parameter value) + (-- register) + (without_fake_parameter body)} + + {//////synthesis.#If when then else} + {//////synthesis.#If (without_fake_parameter when) + (without_fake_parameter then) + (without_fake_parameter else)} + + {//////synthesis.#Get members record} + {//////synthesis.#Get members + (without_fake_parameter record)} + + {//////synthesis.#Case value path} + {//////synthesis.#Case (without_fake_parameter value) + (without_fake_parameter#path without_fake_parameter path)})} + + {//////synthesis.#Loop it} + {//////synthesis.#Loop + (case it + {//////synthesis.#Scope [//////synthesis.#start start + //////synthesis.#inits inits + //////synthesis.#iteration iteration]} + {//////synthesis.#Scope [//////synthesis.#start (-- start) + //////synthesis.#inits (list#each without_fake_parameter inits) + //////synthesis.#iteration iteration]} + + {//////synthesis.#Again _} + it)} + + {//////synthesis.#Function it} + {//////synthesis.#Function + (case it + {//////synthesis.#Abstraction [//////synthesis.#environment environment + //////synthesis.#arity arity + //////synthesis.#body body]} + {//////synthesis.#Abstraction [//////synthesis.#environment (list#each without_fake_parameter environment) + //////synthesis.#arity arity + //////synthesis.#body body]} + + {//////synthesis.#Apply [//////synthesis.#function function + //////synthesis.#arguments arguments]} + {//////synthesis.#Apply [//////synthesis.#function (without_fake_parameter function) + //////synthesis.#arguments (list#each without_fake_parameter arguments)]})})} + + {//////synthesis.#Extension name parameters} + {//////synthesis.#Extension name (list#each without_fake_parameter parameters)})) + (def: overriden_method_definition (Parser [(Environment Synthesis) (/.Overriden_Method Synthesis)]) (<synthesis>.tuple (do <>.monad @@ -863,12 +987,16 @@ (<synthesis>.loop (<>.exactly 0 <synthesis>.any)) <synthesis>.tuple (<>.after <synthesis>.any) - <synthesis>.any)] + <synthesis>.any) + .let [arity (list.size arguments)]] (in [environment [ownerT name strict_fp? annotations vars self_name arguments returnT exceptionsT - (..hidden_method_body (list.size arguments) body)]])))) + (<| (..hidden_method_body arity) + (case arity + 0 (without_fake_parameter body) + _ body))]])))) (def: (normalize_path normalize) (-> (-> Synthesis Synthesis) @@ -1222,7 +1350,7 @@ methods! (|> overriden_methods (list#each (normalized_method global_mapping)) (monad.each ! (method_definition generate archive artifact_id))) - bytecode (<| (at ! each (format.result class.writer)) + bytecode (<| (at ! each (\\format.result class.writer)) //////.lifted (class.class version.v6_0 (all modifier#composite class.public class.final) (name.internal anonymous_class_name) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function.lux index 3de519160..a87be42cc 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function.lux @@ -5,22 +5,22 @@ ["[0]" monad (.only do)]] [data ["[0]" product] + [binary + ["[0]" \\format]] [collection ["[0]" list (.open: "[1]#[0]" monoid functor)] - ["[0]" sequence]] - ["[0]" format - ["[1]" binary]]] + ["[0]" sequence]]] [math [number ["n" nat] ["[0]" i32]]] [target [jvm + ["_" bytecode (.only Label Bytecode) (.open: "[1]#[0]" monad)] ["[0]" version] ["[0]" modifier (.only Modifier) (.open: "[1]#[0]" monoid)] ["[0]" field (.only Field)] ["[0]" method (.only Method)] - ["_" bytecode (.only Label Bytecode) (.open: "[1]#[0]" monad)] ["[0]" class (.only Class)] ["[0]" type (.only Type) [category (.only Return' Value')] @@ -122,7 +122,7 @@ fields methods (sequence.sequence))) - .let [bytecode [function_class (format.result class.writer class)]] + .let [bytecode [function_class (\\format.result class.writer class)]] _ (generation.execute! bytecode) _ (generation.save! (product.right function_context) {.#None} bytecode)] (in instance))) 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 0a1eba71c..eb8478a41 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 @@ -12,16 +12,15 @@ [concurrency ["[0]" atom (.only Atom atom)]]] [data - [binary (.only Binary)] + [binary (.only Binary) + ["[0]" \\format]] ["[0]" product] ["[0]" text (.open: "[1]#[0]" hash) ["%" \\format (.only format)]] [collection ["[0]" array] ["[0]" dictionary (.only Dictionary)] - ["[0]" sequence]] - ["[0]" format - ["[1]" binary]]] + ["[0]" sequence]]] [target [jvm ["_" bytecode (.only Bytecode)] @@ -132,7 +131,7 @@ _.return)})) (sequence.sequence))] (io.run! (do [! (try.with io.monad)] - [bytecode (at ! each (format.result class.writer) + [bytecode (at ! each (\\format.result class.writer) (io.io bytecode)) _ (loader.store eval_class bytecode library) class (loader.load eval_class loader) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/program.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/program.lux index 6f9aa8aa3..a81896178 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/program.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/program.lux @@ -6,10 +6,10 @@ [control ["[0]" try]] [data + [binary + ["[0]" \\format]] [collection - ["[0]" sequence]] - ["[0]" format - ["[1]" binary]]] + ["[0]" sequence]]] [target [jvm ["_" bytecode (.only Bytecode)] @@ -155,7 +155,7 @@ _.return)}) class (artifact_name context)] [class - (<| (format.result class.writer) + (<| (\\format.result class.writer) try.trusted (class.class version.v6_0 ..program::modifier diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/synthesis.lux b/stdlib/source/library/lux/tool/compiler/language/lux/synthesis.lux index 9b61d3737..c4a772695 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/synthesis.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/synthesis.lux @@ -59,8 +59,14 @@ [#locals 0 #currying? false]) +(type: .public (Road value next) + (Record + [#when value + #then next])) + (type: .public (Fork value next) - [[value next] (List [value next])]) + [(Road value next) + (List (Road value next))]) (type: .public (Path' s) (Variant diff --git a/stdlib/source/test/lux/ffi.jvm.lux b/stdlib/source/test/lux/ffi.jvm.lux index 4b924b6a6..e2f50a5e6 100644 --- a/stdlib/source/test/lux/ffi.jvm.lux +++ b/stdlib/source/test/lux/ffi.jvm.lux @@ -319,9 +319,9 @@ [] (actual1 self [throw? java/lang/Boolean]) java/lang/Long "throws" [java/lang/Throwable] - (if (/.of_boolean throw?) - (panic! "YOLO") - (/.as_long (.int expected))))) + (if (not (/.of_boolean throw?)) + (/.as_long (.int expected)) + (panic! "YOLO")))) example/1! (and (case (test/TestInterface1::actual1 (/.as_boolean false) object/1) {try.#Success actual} @@ -401,9 +401,9 @@ (test/TestInterface1 [] (actual1 self [throw? java/lang/Boolean]) java/lang/Long "throws" [java/lang/Throwable] - (if (/.of_boolean throw?) - (panic! "YOLO") - ::value))) + (if (not (/.of_boolean throw?)) + ::value + (panic! "YOLO")))) (/.import test/TestClass1 "[1]::[0]" |