Skip to content

Commit

Permalink
Better syntax for the .when# extension.
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoejp committed Sep 3, 2023
1 parent 3b9cad3 commit 90bdd8c
Show file tree
Hide file tree
Showing 82 changed files with 2,442 additions and 2,311 deletions.
1 change: 1 addition & 0 deletions documentation/bookmark/business/banking.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Reference

0. [Clojure in Banking: Griffin: A fully-regulated, API-driven bank, with Clojure](https://www.juxt.pro/blog/clojure-in-griffin/)
0. [Column: The developer infrastructure bank](https://column.com/)

1 change: 1 addition & 0 deletions documentation/bookmark/coding_style.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Reference

0. [Google Common Lisp Style Guide](https://google.github.io/styleguide/lispguide.xml)
0. [The Ascetic Programmer: How asceticism benefits programming, science, and the arts](https://asceticprogrammer.info/book)
0. [A Guide to Naming Variables](https://a-nickels-worth.blogspot.com/2016/04/a-guide-to-naming-variables.html)
0. [the gizmo's role in markup](https://t-ravis.com/post/doc/the_gizmos_role_in_markup/)
Expand Down
4 changes: 4 additions & 0 deletions documentation/bookmark/compilation/target/common_lisp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Reference

0. [Google Common Lisp Style Guide](https://google.github.io/styleguide/lispguide.xml)

3 changes: 2 additions & 1 deletion documentation/bookmark/database/storage.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Reference

1. [Damn Cool Algorithms: Log structured storage](http://blog.notdot.net/2009/12/Damn-Cool-Algorithms-Log-structured-storage)
0. [TreeLine: An Update-In-Place Key-Value Store for Modern Storage](https://www.vldb.org/pvldb/vol16/p99-yu.pdf)
0. [Damn Cool Algorithms: Log structured storage](http://blog.notdot.net/2009/12/Damn-Cool-Algorithms-Log-structured-storage)

5 changes: 5 additions & 0 deletions documentation/bookmark/law/property/intellectual/copyright.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Reference

0. [Exactly the Wrong AI Copyrightability Case: Creativity Machine guy assumed away the debate and lost](https://writing.kemitchell.com/2023/08/19/Exactly-Wrong-AI-Copyright)
0. [The Grotesque Legacy of Music as Property](https://www.youtube.com/watch?v=MAFUdIZnI5o)

4 changes: 0 additions & 4 deletions documentation/bookmark/property/intellectual/copyright.md

This file was deleted.

2 changes: 1 addition & 1 deletion lux-bootstrapper/src/lux/analyser.clj
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@

;; Pattern-matching syntax.
(&/$Identifier "library/lux" "when#")
(|let [(&/$Item [_ (&/$Variant ?pattern-matching)] (&/$Item ?input (&/$End))) parameters]
(|let [(&/$Item ?input ?pattern-matching) parameters]
(if (even? (&/|length ?pattern-matching))
(&/with-analysis-meta location exo-type
(&&lux/analyse-case analyse exo-type ?input (&/|as-pairs ?pattern-matching)))
Expand Down
3,060 changes: 1,533 additions & 1,527 deletions stdlib/source/library/lux.lux

Large diffs are not rendered by default.

27 changes: 14 additions & 13 deletions stdlib/source/library/lux/control/aspect.lux
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
["[0]" meta (.only)
[extension (.only analysis declaration)]
["[0]" binding]
["[0]" module]
["[0]" code (.only)
["?[1]" \\projection]]
["[0]" macro (.only)
Expand All @@ -37,7 +38,7 @@
["[0]" phase]
["[0]" declaration]
["[0]" analysis (.only)
["[0]" module]
["[0]A" module]
["[0]" type]]]]]]]])

(every .public (Advice value)
Expand Down Expand Up @@ -129,7 +130,7 @@
(Meta [Bit .Global]))
(do meta.monad
[name (binding.normal name)
current_module_name meta.current_module_name
[current_module_name _] module.current
lux meta.compiler_state]
(loop (again [[normal_module normal_short] name])
(when (is (Maybe [Bit .Global])
Expand Down Expand Up @@ -166,9 +167,9 @@
['cache (macro.symbol "'cache")
[exported? global] (global_reference name)
.let [cache_name (%.code 'cache)]
_ (module.define cache_name [exported? global])
_ (moduleA.define cache_name [exported? global])
it (then ['cache global])
current_module_name meta.current_module_name
[current_module_name _] module.current
_ (without_global [current_module_name cache_name])]
(in it)))

Expand All @@ -183,10 +184,10 @@
(global_reference name))
.let [cache_name (%.code 'cache)]
_ (declaration.of_analysis
(module.define cache_name [exported? global]))
(moduleA.define cache_name [exported? global]))
it (then ['cache global])
current_module_name (declaration.of_analysis
meta.current_module_name)
[current_module_name _] (declaration.of_analysis
module.current)
_ (declaration.of_analysis
(without_global [current_module_name cache_name]))]
(in it)))
Expand All @@ -197,9 +198,9 @@
(analysis.Operation of)))
(do phase.monad
[[exported? old] (global_reference name)
_ (module.override_definition name [exported? (new old)])
_ (moduleA.override_definition name [exported? (new old)])
it then
_ (module.override_definition name [exported? old])]
_ (moduleA.override_definition name [exported? old])]
(in it)))

(the (with_temporary_global' [name new] then)
Expand All @@ -210,10 +211,10 @@
[[exported? old] (declaration.of_analysis
(global_reference name))
_ (declaration.of_analysis
(module.override_definition name [exported? (new old)]))
(moduleA.override_definition name [exported? (new old)]))
it then
_ (declaration.of_analysis
(module.override_definition name [exported? old]))]
(moduleA.override_definition name [exported? old]))]
(in it)))

(the (expression type term)
Expand All @@ -232,9 +233,9 @@
(do phase.monad
['cache (macro.symbol "'cache")
.let [cache_name (%.code 'cache)]
_ (module.define cache_name [false {.#Definition [Analysis (expression type term)]}])
_ (moduleA.define cache_name [false {.#Definition [Analysis (expression type term)]}])
it (then 'cache)
current_module_name meta.current_module_name
[current_module_name _] module.current
_ (without_global [current_module_name cache_name])]
(in it)))

Expand Down
3 changes: 2 additions & 1 deletion stdlib/source/library/lux/control/exception.lux
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
[number
["n" nat (.use "[1]#[0]" decimal)]]]
["[0]" meta (.only)
["[0]" module]
["[0]" code (.only)
["<[1]>" \\projection (.only Projection)]]
["[0]" macro (.only)
Expand Down Expand Up @@ -103,7 +104,7 @@
(syntax.macro (_ [[export_policy [[name input] type body]] ..exceptionP])
(macro.with_symbols [g!descriptor]
(do meta.monad
[current_module meta.current_module_name]
[[current_module _] module.current]
(let [descriptor (all text#composite "{" current_module "." name "}" text.new_line)
g!self (code.local name)]
(in (list (` (.the (, export_policy)
Expand Down
3 changes: 2 additions & 1 deletion stdlib/source/library/lux/control/function/inline.lux
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
[collection
["[0]" list (.use "[1]#[0]" monad)]]]
["[0]" meta (.only)
["[0]" module]
["[0]" code (.only)
["<[1]>" \\projection (.only Projection)]]
["[0]" macro (.only with_symbols)
Expand All @@ -36,7 +37,7 @@
(syntax.macro (_ [[[name parameters] type term] ..inline])
(with_symbols [g!_]
(do [! meta.monad]
[@ meta.current_module_name
[[@ _] module.current
g!parameters (|> (macro.symbol "parameter")
(list.repeated (list.size parameters))
(monad.all !))
Expand Down
5 changes: 3 additions & 2 deletions stdlib/source/library/lux/control/function/mutual.lux
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
[collection
["[0]" list (.use "[1]#[0]" functor)]]]
["[0]" meta (.only)
["[0]" module]
["[0]" code (.only)
["<[1]>" \\projection (.only Projection)]]
["[0]" macro (.only)
Expand Down Expand Up @@ -68,7 +69,7 @@
_
(macro.with_symbols [g!context g!output]
(do [! meta.monad]
[here_name meta.current_module_name
[[here_name _] module.current
hidden_names (monad.each ! (//.constant (macro.symbol "mutual_function#"))
functions)
.let [definitions (list#each (..mutual_definition hidden_names g!context)
Expand Down Expand Up @@ -121,7 +122,7 @@
_
(macro.with_symbols [g!context g!output]
(do [! meta.monad]
[here_name meta.current_module_name
[[here_name _] module.current
hidden_names (monad.each ! (//.constant (macro.symbol "mutual_function#"))
functions)
.let [definitions (list#each (..mutual_definition hidden_names g!context)
Expand Down
3 changes: 2 additions & 1 deletion stdlib/source/library/lux/control/function/named.lux
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
[number
["n" nat]]]
["[0]" meta (.only)
["[0]" module]
["[0]" code (.only)
["?[1]" \\projection]]
[macro (.only with_symbols)
Expand Down Expand Up @@ -49,7 +50,7 @@
?code.any
?code.any))])
(do meta.monad
[here meta.current_module_name]
[[here _] module.current]
(if (n.= (list.size parameters)
(set.size (set.of_list text.hash parameters)))
(with_symbols ['function 'parameters '_ 'it 'error]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
["[0]" set (.only Set)]
["[0]" list (.use "[1]#[0]" functor)]]]
["[0]" meta (.only)
["[0]" module]
["[0]" symbol]
["[0]" static]
["[0]" code (.only)
Expand Down Expand Up @@ -49,7 +50,7 @@
(.the .public layer
(syntax.macro (_ [[export_policy name] (export.with ?code.local)])
(do meta.monad
[@ meta.current_module_name]
[[@ _] module.current]
(in (list (` (.the (, export_policy) (, (code.local name))
Layer
(<| (as Layer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
["[0]" dictionary (.only Dictionary)]
["[0]" list (.use "[1]#[0]" mix)]]]
["[0]" meta (.only)
["[0]" module]
["[0]" binding]
["[0]" symbol]
["[0]" type (.only)
Expand Down Expand Up @@ -106,7 +107,7 @@
type ?code.any
term ?code.any])
(do meta.monad
[here meta.current_module_name
[[here _] module.current
macro.with_symbols ['_ 'next]
.let ['name (code.local name)]]
(in (list (` (.the (, policy) (, 'name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
[collection
["[0]" list (.use "[1]#[0]" functor)]]]
["[0]" meta (.only)
["[0]" module]
["[0]" code (.only)
["?[1]" \\projection (.only Projection)]]
["[0]" macro (.only with_symbols)
Expand Down Expand Up @@ -44,7 +45,7 @@
?code.any
(?.many ?code.any)))])
(<| (do meta.monad
[@ meta.current_module_name
[[@ _] module.current
'interface (macro.symbol name)
'method (macro.symbol name)])
(with_symbols ['_ 'inputs])
Expand Down
3 changes: 2 additions & 1 deletion stdlib/source/library/lux/control/function/variadic.lux
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
[number
["n" nat]]]
["[0]" meta (.only)
["[0]" module]
["[0]" code (.only)
["?[1]" \\projection]]
[macro (.only with_symbols)
Expand All @@ -44,7 +45,7 @@
?code.any
?code.any))])
(do meta.monad
[here meta.current_module_name]
[[here _] module.current]
(if (n.= (list.size parameters)
(set.size (set.of_list text.hash parameters)))
(with_symbols [g!function]
Expand Down
3 changes: 2 additions & 1 deletion stdlib/source/library/lux/control/scope/dynamic.lux
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
["[0]" dictionary (.only Dictionary)]
["[0]" list (.use "[1]#[0]" mix)]]]
["[0]" meta (.only)
["[0]" module]
["[0]" binding]
["[0]" symbol]
["[0]" code (.only)
Expand Down Expand Up @@ -52,7 +53,7 @@
type ?code.any
term ?code.any])
(do meta.monad
[here meta.current_module_name
[[here _] module.current
macro.with_symbols ['default 'token]]
(in (list (` (.the (, policy) (, (code.local name))
(Dynamic (, type))
Expand Down
3 changes: 2 additions & 1 deletion stdlib/source/library/lux/control/security/capability.lux
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
[collection
["[0]" list (.use "[1]#[0]" functor)]]]
["[0]" meta (.only)
["[0]" module]
["[0]" code (.only)
["<[1]>" \\projection]]
["[0]" macro (.only)
Expand Down Expand Up @@ -44,7 +45,7 @@
(<code>.form (all <>.and <code>.local <code>.any <code>.any))))])
(macro.with_symbols [g!_]
(do [! meta.monad]
[this_module meta.current_module_name
[[this_module _] module.current
.let [[name vars] declaration]
g!brand (of ! each (|>> %.code code.text)
(macro.symbol (%.message (%.symbol [this_module name]))))
Expand Down
3 changes: 2 additions & 1 deletion stdlib/source/library/lux/data/text/regex.lux
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
[number (.only hex)
["n" nat (.use "[1]#[0]" decimal)]]]
["[0]" meta (.only)
["[0]" module]
["[0]" code (.only)
["<[1]>" \\projection]]
[macro (.only with_symbols)
Expand Down Expand Up @@ -444,7 +445,7 @@
(the .public regex
(syntax.macro (_ [pattern <code>.text])
(do meta.monad
[current_module meta.current_module_name]
[[current_module _] module.current]
(when (<text>.value (regex^ current_module)
pattern)
{try.#Failure error}
Expand Down
Loading

0 comments on commit 90bdd8c

Please sign in to comment.