aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--commands.md22
-rw-r--r--licentia/commands.md26
-rw-r--r--licentia/project.clj33
-rw-r--r--licentia/source/program/licentia.lux (renamed from stdlib/source/program/licentia.lux)49
-rw-r--r--licentia/source/program/licentia/document.lux (renamed from stdlib/source/program/licentia/document.lux)10
-rw-r--r--licentia/source/program/licentia/input.lux (renamed from stdlib/source/program/licentia/input.lux)29
-rw-r--r--licentia/source/program/licentia/license.lux (renamed from stdlib/source/program/licentia/license.lux)38
-rw-r--r--licentia/source/program/licentia/license/addendum.lux (renamed from stdlib/source/program/licentia/license/addendum.lux)6
-rw-r--r--licentia/source/program/licentia/license/assurance.lux (renamed from stdlib/source/program/licentia/license/assurance.lux)6
-rw-r--r--licentia/source/program/licentia/license/black_list.lux (renamed from stdlib/source/program/licentia/license/black-list.lux)14
-rw-r--r--licentia/source/program/licentia/license/commercial.lux (renamed from stdlib/source/program/licentia/license/commercial.lux)14
-rw-r--r--licentia/source/program/licentia/license/copyright.lux (renamed from stdlib/source/program/licentia/license/copyright.lux)0
-rw-r--r--licentia/source/program/licentia/license/definition.lux (renamed from stdlib/source/program/licentia/license/definition.lux)122
-rw-r--r--licentia/source/program/licentia/license/distribution.lux (renamed from stdlib/source/program/licentia/license/distribution.lux)86
-rw-r--r--licentia/source/program/licentia/license/extension.lux (renamed from stdlib/source/program/licentia/license/extension.lux)118
-rw-r--r--licentia/source/program/licentia/license/grant.lux (renamed from stdlib/source/program/licentia/license/grant.lux)78
-rw-r--r--licentia/source/program/licentia/license/liability.lux (renamed from stdlib/source/program/licentia/license/liability.lux)118
-rw-r--r--licentia/source/program/licentia/license/limitation.lux (renamed from stdlib/source/program/licentia/license/limitation.lux)18
-rw-r--r--licentia/source/program/licentia/license/miscellaneous.lux (renamed from stdlib/source/program/licentia/license/miscellaneous.lux)52
-rw-r--r--licentia/source/program/licentia/license/notice.lux (renamed from stdlib/source/program/licentia/license/notice.lux)21
-rw-r--r--licentia/source/program/licentia/license/submission.lux (renamed from stdlib/source/program/licentia/license/submission.lux)0
-rw-r--r--licentia/source/program/licentia/license/term.lux (renamed from stdlib/source/program/licentia/license/term.lux)18
-rw-r--r--licentia/source/program/licentia/license/time.lux (renamed from stdlib/source/program/licentia/license/time.lux)0
-rw-r--r--licentia/source/program/licentia/output.lux (renamed from stdlib/source/program/licentia/output.lux)112
-rw-r--r--licentia/source/test/licentia.lux (renamed from stdlib/source/test/licentia.lux)163
-rw-r--r--stdlib/project.clj6
-rw-r--r--stdlib/source/lux/control/function.lux5
-rw-r--r--stdlib/source/lux/control/function/mutual.lux242
-rw-r--r--stdlib/source/lux/macro/template.lux2
-rw-r--r--stdlib/source/lux/meta.lux2
-rw-r--r--stdlib/source/lux/target.lux6
-rw-r--r--stdlib/source/lux/world/output/video/resolution.lux24
-rw-r--r--stdlib/source/program/aedifex/artifact/time.lux12
-rw-r--r--stdlib/source/program/aedifex/metadata/snapshot.lux3
-rw-r--r--stdlib/source/program/aedifex/repository/local.lux10
-rw-r--r--stdlib/source/test/aedifex.lux83
-rw-r--r--stdlib/source/test/aedifex/command.lux32
-rw-r--r--stdlib/source/test/aedifex/command/install.lux20
-rw-r--r--stdlib/source/test/aedifex/command/pom.lux5
-rw-r--r--stdlib/source/test/aedifex/command/version.lux4
-rw-r--r--stdlib/source/test/lux/control/function.lux4
-rw-r--r--stdlib/source/test/lux/control/function/mutual.lux65
-rw-r--r--stdlib/source/test/lux/world.lux6
-rw-r--r--stdlib/source/test/lux/world/output/video/resolution.lux63
45 files changed, 1105 insertions, 646 deletions
diff --git a/.gitignore b/.gitignore
index 59455a52a..178401ebb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,6 +16,10 @@ pom.xml.asc
/lux-lein/target
+/licentia/target
+/licentia/source/lux.lux
+/licentia/source/lux
+
/lux-jvm/target
/lux-jvm/source/lux.lux
/lux-jvm/source/lux
diff --git a/commands.md b/commands.md
index 961d0220b..527b2b36c 100644
--- a/commands.md
+++ b/commands.md
@@ -106,25 +106,3 @@ cd ~/lux/stdlib/ && lein clean && lein with-profile aedifex lux auto test
cd ~/lux/lux-lein/ && lein install
```
----
-
-# Licentia: License maker
-
-## Build
-
-```
-cd ~/lux/stdlib/ && lein clean && lein with-profile licentia lux auto build
-```
-
-## Test
-
-```
-cd ~/lux/stdlib/ && lein clean && lein with-profile licentia lux auto test
-```
-
-## Run
-
-```
-cd ~/lux/stdlib/ && java -jar target/program.jar --input ../license.json --output ../license.txt
-```
-
diff --git a/licentia/commands.md b/licentia/commands.md
new file mode 100644
index 000000000..58ac36376
--- /dev/null
+++ b/licentia/commands.md
@@ -0,0 +1,26 @@
+## Build
+
+```
+## Develop
+cd ~/lux/licentia/ \
+&& lein clean \
+&& lein lux auto build
+```
+
+## Test
+
+```
+## Develop
+cd ~/lux/licentia/ \
+&& lein clean \
+&& lein lux auto test
+```
+
+## Run
+
+```
+## Re-generate Lux's license.
+cd ~/lux/licentia/ \
+&& java -jar target/program.jar --input ../license.json --output ../license.txt
+```
+
diff --git a/licentia/project.clj b/licentia/project.clj
new file mode 100644
index 000000000..97756c024
--- /dev/null
+++ b/licentia/project.clj
@@ -0,0 +1,33 @@
+(def version "0.6.0-SNAPSHOT")
+(def repo "https://github.com/LuxLang/lux")
+(def sonatype-releases "https://oss.sonatype.org/service/local/staging/deploy/maven2/")
+(def sonatype-snapshots "https://oss.sonatype.org/content/repositories/snapshots/")
+
+(defproject com.github.luxlang/licentia #=(identity version)
+ :description "A program for producing free/open-source/reciprocal licenses."
+
+ :url ~(str repo "/licentia")
+ :license {:name "Lux License v0.1.1"
+ :url ~(str repo "/blob/master/license.txt")}
+
+ :repositories [["releases" ~sonatype-releases]
+ ["snapshots" ~sonatype-snapshots]]
+ :deploy-repositories [["releases" {:url ~sonatype-releases :creds :gpg}]
+ ["snapshots" {:url ~sonatype-snapshots :creds :gpg}]]
+
+ :plugins [[com.github.luxlang/lein-luxc ~version]]
+
+ :dependencies [[com.github.luxlang/luxc-jvm ~version]
+ [com.github.luxlang/stdlib ~version]]
+
+ :pom-addition [:developers [:developer
+ [:name "Eduardo Julian"]
+ [:url "https://github.com/eduardoejp"]]]
+ :scm {:name "git"
+ :url ~(str repo ".git")}
+ :manifest {"lux" ~version}
+
+ :source-paths ["source"]
+ :lux {:program "program/licentia"
+ :test "test/licentia"}
+ )
diff --git a/stdlib/source/program/licentia.lux b/licentia/source/program/licentia.lux
index 896f74dab..57ed832e5 100644
--- a/stdlib/source/program/licentia.lux
+++ b/licentia/source/program/licentia.lux
@@ -13,15 +13,17 @@
(.module:
[lux #*
- [host (#+ import:)]
+ [ffi (#+ import:)]
+ [program (#+ program:)]
+ ["." debug]
[abstract
[monad (#+ do)]]
[control
- [remember (#+ to-do)]
+ [remember (#+ to_do)]
["." io (#+ IO) ("#\." monad)]
["." try (#+ Try)]
["." parser
- ["." cli (#+ program:)]
+ ["<.>" cli]
["<.>" json]]
[security
["!" capability]]]
@@ -29,7 +31,8 @@
["." maybe]
["." text
["%" format (#+ format)]
- ["." encoding]]
+ [encoding
+ ["." utf8]]]
[format
["." json]]]
[world
@@ -38,32 +41,32 @@
["#." input]
["#." output]])
-(with-expansions [<expiry> "2021-04-01"]
- (to-do <expiry> "Replace _.work with _.covered-work or _.licensed-work")
- (to-do <expiry> "Create a short notice to add as a comment to each file in the _.work"))
+(with_expansions [<expiry> "2022-04-01"]
+ (to_do <expiry> "Replace _.work with _.covered_work or _.licensed_work")
+ (to_do <expiry> "Create a short notice to add as a comment to each file in the _.work"))
(import: java/lang/String
["#::."
(trim [] java/lang/String)])
-(def: default-output-file "LICENSE")
+(def: default_output_file "LICENSE")
-(def: (success-message output)
+(def: (success_message output)
(-> Path Text)
- (format "Your license has been made!" text.new-line
+ (format "Your license has been made!" text.new_line
"Check the file " output "."))
-(program: [{input (cli.named "--input" cli.any)}
- {output (parser.default ..default-output-file
- (cli.named "--output" cli.any))}]
+(program: [{input (<cli>.named "--input" <cli>.any)}
+ {output (parser.default ..default_output_file
+ (<cli>.named "--output" <cli>.any))}]
(do io.monad
[?done (: (IO (Try Any))
(do (try.with io.monad)
[file (!.use (\ file.default file) [input])
blob (!.use (\ file content) [])
document (io\wrap (do {! try.monad}
- [raw-json (\ encoding.utf8 decode blob)
- json (|> raw-json
+ [raw_json (\ utf8.codec decode blob)
+ json (|> raw_json
(:coerce java/lang/String)
java/lang/String::trim
(:coerce Text)
@@ -71,12 +74,12 @@
(|> json
(<json>.run /input.license)
(\ ! map /output.license))))
- output-file (: (IO (Try (File IO)))
- (file.get-file io.monad file.default output))]
- (!.use (\ output-file over-write) (\ encoding.utf8 encode document))))]
- (wrap (log! (case ?done
- (#try.Success _)
- (success-message output)
+ output_file (: (IO (Try (File IO)))
+ (file.get_file io.monad file.default output))]
+ (!.use (\ output_file over_write) (\ utf8.codec encode document))))]
+ (wrap (debug.log! (case ?done
+ (#try.Success _)
+ (success_message output)
- (#try.Failure message)
- message)))))
+ (#try.Failure message)
+ message)))))
diff --git a/stdlib/source/program/licentia/document.lux b/licentia/source/program/licentia/document.lux
index b1bc20cce..95c14e231 100644
--- a/stdlib/source/program/licentia/document.lux
+++ b/licentia/source/program/licentia/document.lux
@@ -8,11 +8,11 @@
(def: #export (quote text)
(-> Text Text)
- (format text.double-quote text text.double-quote))
+ (format text.double_quote text text.double_quote))
(def: #export (block content)
(-> Text Text)
- (format content text.new-line text.new-line))
+ (format content text.new_line text.new_line))
(def: #export (plural singular)
(-> Text Text)
@@ -25,12 +25,12 @@
(def: #export paragraph
(-> (List Text) Text)
(|>> (list\map ..sentence)
- (text.join-with text.new-line)))
+ (text.join_with text.new_line)))
(template [<name> <word>]
[(def: #export <name>
(-> (List Text) Text)
- (text.join-with (format ", " <word> " ")))]
+ (text.join_with (format ", " <word> " ")))]
[or "or"]
[and "and"]
@@ -43,5 +43,5 @@
(def: #export (section value)
(-> Section Text)
- (format (block (get@ #title value))
+ (format (..block (get@ #title value))
(get@ #content value)))
diff --git a/stdlib/source/program/licentia/input.lux b/licentia/source/program/licentia/input.lux
index 5ec07e32b..52205762d 100644
--- a/stdlib/source/program/licentia/input.lux
+++ b/licentia/source/program/licentia/input.lux
@@ -8,7 +8,8 @@
["<.>" json (#+ Parser)]]]
[data
[text
- ["%" format (#+ format)]]
+ ["%" format (#+ format)]]]
+ [math
[number
["n" nat]
["i" int]
@@ -20,7 +21,7 @@
Distribution
Commercial
Extension
- Entity Black-List
+ Entity Black_List
URL Attribution
Addendum
License)
@@ -34,11 +35,11 @@
(<json>.field "name" <json>.string)
(<json>.field "version" <json>.string))))
-(exception: #export (cannot-use-fractional-amount {amount Frac})
+(exception: #export (cannot_use_fractional_amount {amount Frac})
(exception.report
["Amount" (%.frac amount)]))
-(exception: #export (cannot-use-negative-amount {amount Int})
+(exception: #export (cannot_use_negative_amount {amount Int})
(exception.report
["Amount" (%.int amount)]))
@@ -47,14 +48,14 @@
(do <>.monad
[amountF <json>.number
#let [amountI (f.int amountF)]
- _ (<>.assert (exception.construct cannot-use-fractional-amount amountF)
+ _ (<>.assert (exception.construct ..cannot_use_fractional_amount [amountF])
(f.= amountF
(i.frac amountI)))
- _ (<>.assert (exception.construct cannot-use-negative-amount amountI)
+ _ (<>.assert (exception.construct ..cannot_use_negative_amount [amountI])
(i.> +0 amountI))]
(wrap (.nat amountI))))
-(exception: #export (invalid-period {period (Period Nat)})
+(exception: #export (invalid_period {period (Period Nat)})
(exception.report
["Start" (%.nat (get@ #time.start period))]
["End" (%.nat (get@ #time.end period))]))
@@ -67,11 +68,11 @@
end (<json>.field "end" ..amount)
#let [period {#time.start start
#time.end end}]
- _ (<>.assert (exception.construct invalid-period period)
+ _ (<>.assert (exception.construct ..invalid_period [period])
(n.<= end start))]
(wrap period))))
-(def: copyright-holder
+(def: copyright_holder
(Parser copyright.Holder)
(<json>.object
($_ <>.and
@@ -121,8 +122,8 @@
(Parser Entity)
<json>.string)
-(def: black-list
- (Parser Black-List)
+(def: black_list
+ (Parser Black_List)
(<json>.object
($_ <>.and
(<json>.field "justification" (<json>.nullable <json>.string))
@@ -152,15 +153,15 @@
(Parser License)
(<json>.object
($_ <>.and
- (<json>.field "copyright-holders" (<json>.array (<>.many ..copyright-holder)))
+ (<json>.field "copyright-holders" (<json>.array (<>.many ..copyright_holder)))
(<json>.field "identification" (<json>.nullable ..identification))
(<json>.field "termination" ..termination)
(<json>.field "liability" ..liability)
(<json>.field "distribution" ..distribution)
(<json>.field "commercial" ..commercial)
(<json>.field "extension" ..extension)
- (<json>.field "black-lists" (<json>.array (<>.some ..black-list)))
+ (<json>.field "black-lists" (<json>.array (<>.some ..black_list)))
(<json>.field "attribution" (<json>.nullable ..attribution))
- (<>.default {#//.commons-clause? false}
+ (<>.default {#//.commons_clause? false}
(<json>.field "addendum" ..addendum))
)))
diff --git a/stdlib/source/program/licentia/license.lux b/licentia/source/program/licentia/license.lux
index c62c8419d..ad7328641 100644
--- a/stdlib/source/program/licentia/license.lux
+++ b/licentia/source/program/licentia/license.lux
@@ -9,54 +9,54 @@
#version Text})
(type: #export Termination
- {#patent-retaliation? Bit
- #termination-period Days
- #grace-period Days})
+ {#patent_retaliation? Bit
+ #termination_period Days
+ #grace_period Days})
(type: #export Liability
- {#can-accept? Bit
- #disclaim-high-risk? Bit})
+ {#can_accept? Bit
+ #disclaim_high_risk? Bit})
(type: #export Distribution
- {#can-re-license? Bit
- #can-multi-license? Bit})
+ {#can_re_license? Bit
+ #can_multi_license? Bit})
(type: #export Commercial
- {#can-sell? Bit
- #require-contributor-credit? Bit
- #allow-contributor-endorsement? Bit})
+ {#can_sell? Bit
+ #require_contributor_credit? Bit
+ #allow_contributor_endorsement? Bit})
(type: #export Extension
- {#same-license? Bit
- #must-be-distinguishable? Bit
- #notification-period (Maybe (Period Months))
- #must-describe-modifications? Bit})
+ {#same_license? Bit
+ #must_be_distinguishable? Bit
+ #notification_period (Maybe (Period Months))
+ #must_describe_modifications? Bit})
(type: #export Entity Text)
-(type: #export Black-List
+(type: #export Black_List
{#justification (Maybe Text)
#entities (List Entity)})
(type: #export URL Text)
(type: #export Attribution
- {#copyright-notice Text
+ {#copyright_notice Text
#phrase (Maybe Text)
#url URL
#image (Maybe URL)})
(type: #export Addendum
- {#commons-clause? Bit})
+ {#commons_clause? Bit})
(type: #export License
- {#copyright-holders (List /copyright.Holder)
+ {#copyright_holders (List /copyright.Holder)
#identification (Maybe Identification)
#termination Termination
#liability Liability
#distribution Distribution
#commercial Commercial
#extension Extension
- #black-lists (List Black-List)
+ #black_lists (List Black_List)
#attribution (Maybe Attribution)
#addendum Addendum})
diff --git a/stdlib/source/program/licentia/license/addendum.lux b/licentia/source/program/licentia/license/addendum.lux
index 7e467c630..e4a8d6364 100644
--- a/stdlib/source/program/licentia/license/addendum.lux
+++ b/licentia/source/program/licentia/license/addendum.lux
@@ -8,7 +8,7 @@
["$" document]]])
## https://commonsclause.com/
-(def: #export commons-clause
+(def: #export commons_clause
Text
(format ($.block "The Software is provided to you by the Licensor under the License, as defined below, subject to the following condition.")
($.block "Without limiting other conditions in the License, the grant of rights under the License will not include, and the License does not grant to you, the right to Sell the Software.")
@@ -23,6 +23,6 @@
"")]
["“Commons Clause” License Condition v1.0"
- (get@ #//.commons-clause? value)
- ..commons-clause]
+ (get@ #//.commons_clause? value)
+ ..commons_clause]
)))))
diff --git a/stdlib/source/program/licentia/license/assurance.lux b/licentia/source/program/licentia/license/assurance.lux
index 155472cd1..5c1adfef7 100644
--- a/stdlib/source/program/licentia/license/assurance.lux
+++ b/licentia/source/program/licentia/license/assurance.lux
@@ -15,11 +15,11 @@
" are its original creation(s) or it has sufficient rights to grant the rights to its " ($.plural _.contribution)
" conveyed by " _.license)))
-(def: #export fair-use
- (let [copyright-doctrines (: (List Text)
+(def: #export fair_use
+ (let [copyright_doctrines (: (List Text)
(list "fair use"
"fair dealing"
"other equivalents"))]
($.sentence (format _.license
" is not intended to limit any rights " _.recipient
- " has under applicable copyright doctrines of " ($.or copyright-doctrines)))))
+ " has under applicable copyright doctrines of " ($.or copyright_doctrines)))))
diff --git a/stdlib/source/program/licentia/license/black-list.lux b/licentia/source/program/licentia/license/black_list.lux
index 14dcdfe91..d260f1865 100644
--- a/stdlib/source/program/licentia/license/black-list.lux
+++ b/licentia/source/program/licentia/license/black_list.lux
@@ -6,7 +6,7 @@
["%" format (#+ format)]]
[collection
["." list ("#\." functor)]]]]
- ["." // (#+ Entity Black-List)
+ ["." // (#+ Entity Black_List)
["_" term]
[//
["$" document]]])
@@ -15,17 +15,17 @@
(-> Entity Text)
%.text)
-(def: #export (black-list black-list)
- (-> Black-List Text)
+(def: #export (black_list black_list)
+ (-> Black_List Text)
(let [scope (format "The rights granted under " _.license)
effect "shall not be granted to the following entities, or any subsidiary thereof"
- justification (|> black-list
+ justification (|> black_list
(get@ #//.justification)
(maybe\map (|>> (format ", due to ")))
(maybe.default ""))
- entities (|> black-list
+ entities (|> black_list
(get@ #//.entities)
(list\map ..entity)
- (text.join-with text.new-line))]
- (format scope " " effect justification ":" text.new-line
+ (text.join_with text.new_line))]
+ (format scope " " effect justification ":" text.new_line
entities)))
diff --git a/stdlib/source/program/licentia/license/commercial.lux b/licentia/source/program/licentia/license/commercial.lux
index e044baa43..a17acdbb3 100644
--- a/stdlib/source/program/licentia/license/commercial.lux
+++ b/licentia/source/program/licentia/license/commercial.lux
@@ -8,21 +8,21 @@
[//
["$" document]]])
-(def: #export cannot-sell
+(def: #export cannot_sell
(let [preamble (format "Without limiting other conditions in " _.license)
- direct-condition (format "the grant of rights under " _.license
+ direct_condition (format "the grant of rights under " _.license
" will not include, and does not grant to " _.recipient
", the right to " _.sell " " _.work)
- derivative-condition (format "or any " _.derivative-work)]
+ derivative_condition (format "or any " _.derivative_work)]
($.sentence (format preamble
- ", " direct-condition
- ", " derivative-condition))))
+ ", " direct_condition
+ ", " derivative_condition))))
-(def: #export require-contributor-attribution
+(def: #export require_contributor_attribution
($.sentence (format "All advertising materials mentioning features or use of " _.work
" must include an acknowledgement of the authorship of every " _.contributor)))
-(def: #export disallow-contributor-endorsement
+(def: #export disallow_contributor_endorsement
(let [subject (format "The name of no " _.contributor)
capability "endorse or promote products"
source (format "any " _.extension)
diff --git a/stdlib/source/program/licentia/license/copyright.lux b/licentia/source/program/licentia/license/copyright.lux
index 872af9d2b..872af9d2b 100644
--- a/stdlib/source/program/licentia/license/copyright.lux
+++ b/licentia/source/program/licentia/license/copyright.lux
diff --git a/stdlib/source/program/licentia/license/definition.lux b/licentia/source/program/licentia/license/definition.lux
index 6739039dc..e93230b33 100644
--- a/stdlib/source/program/licentia/license/definition.lux
+++ b/licentia/source/program/licentia/license/definition.lux
@@ -10,10 +10,10 @@
{#term Text
#meaning Text})
-(def: not-a-contribution-notice
- (format text.double-quote "Not a Contribution" text.double-quote))
+(def: not_a_contribution_notice
+ (format text.double_quote "Not a Contribution" text.double_quote))
-(def: #export patent-rights
+(def: #export patent_rights
(List Text)
(list "make"
"have made"
@@ -23,7 +23,7 @@
"import"
"transfer"))
-(def: commercial-services
+(def: commercial_services
(List Text)
(let [services (: (-> Text Text)
(function (_ type)
@@ -32,7 +32,7 @@
(services "consulting")
(services "support"))))
-(def: individual-capacities
+(def: individual_capacities
(List Text)
(list "officer"
"employee"
@@ -40,7 +40,7 @@
"independent contractor"
"agent of a corporation, business or organization (commercial or non-commercial)"))
-(def: covered-work-description
+(def: covered_work_description
"work of authorship")
(template [<name> <term> <meaning>]
@@ -55,7 +55,7 @@
[licensable "Licensable"
($.paragraph (list (format "having the right to grant any and all of the rights conveyed by " (get@ #term license))))]
- [legal-entity "Legal Entity"
+ [legal_entity "Legal Entity"
(let [abilities (: (List Text)
(list "to enter into contracts"
"to sue"
@@ -63,38 +63,38 @@
($.paragraph (list (format "any human or non-human entity that is recognized as having privileges and obligations, such as having the ability " ($.and abilities)))))]
[recipient "Recipient"
- ($.paragraph (list (format "a " (get@ #term legal-entity) " exercising permissions by " (get@ #term license))))]
+ ($.paragraph (list (format "a " (get@ #term legal_entity) " exercising permissions by " (get@ #term license))))]
[licensor "The Licensor"
- ($.paragraph (list (format "the copyright owner granting " (get@ #term license) ", or a " (get@ #term legal-entity) " authorized by the copyright owner")))]
+ ($.paragraph (list (format "the copyright owner granting " (get@ #term license) ", or a " (get@ #term legal_entity) " authorized by the copyright owner")))]
- [source-code-form "Source Code Form"
- ($.paragraph (list (format "the preferred form of the " ..covered-work-description " in order to make modifications to it")))]
+ [source_code_form "Source Code Form"
+ ($.paragraph (list (format "the preferred form of the " ..covered_work_description " in order to make modifications to it")))]
- [object-form "Object Form"
- ($.paragraph (list (format "any form produced by transforming a " (get@ #term source-code-form) ", including but not limited to compiled code and transpiled code")))]
+ [object_form "Object Form"
+ ($.paragraph (list (format "any form produced by transforming a " (get@ #term source_code_form) ", including but not limited to compiled code and transpiled code")))]
[work "The Work"
- ($.paragraph (list (format "the " ..covered-work-description
- ", whether in a " (get@ #term source-code-form)
- " or in an " (get@ #term object-form)
+ ($.paragraph (list (format "the " ..covered_work_description
+ ", whether in a " (get@ #term source_code_form)
+ " or in an " (get@ #term object_form)
", made available under " (get@ #term license)
- ", as indicated by a copyright notice that is included in or attached to the " ..covered-work-description)))]
+ ", as indicated by a copyright notice that is included in or attached to the " ..covered_work_description)))]
- [derivative-work "Derivative Work"
- ($.paragraph (list (format "any work, whether in a " (get@ #term source-code-form)
- " or in an " (get@ #term object-form)
+ [derivative_work "Derivative Work"
+ ($.paragraph (list (format "any work, whether in a " (get@ #term source_code_form)
+ " or in an " (get@ #term object_form)
", that is based on (or derived from) " (get@ #term work)
- " and which represents an original " ..covered-work-description)))]
+ " and which represents an original " ..covered_work_description)))]
[submission "Submission"
- (let [forms-of-communication (: (List Text)
+ (let [forms_of_communication (: (List Text)
(list "electronic"
"verbal"
"written"))]
- ($.paragraph (list (format "any form of " ($.or forms-of-communication) " communication sent to " (get@ #term licensor)
+ ($.paragraph (list (format "any form of " ($.or forms_of_communication) " communication sent to " (get@ #term licensor)
", or its representatives, for the purpose of discussing and improving " (get@ #term work)
- ", but excluding communication that is designated in writing by the copyright owner as " not-a-contribution-notice))))]
+ ", but excluding communication that is designated in writing by the copyright owner as " not_a_contribution_notice))))]
[modification "Modification"
(let [alteration "any addition to, or deletion from, the substance or structure of"
@@ -105,7 +105,7 @@
(format "any " object " which replaces or otherwise alters the original functionality of "(get@ #term work) " at runtime")))]
($.paragraph (list (format alteration " " ($.or targets)))))]
- [required-component "Required Component"
+ [required_component "Required Component"
(let [possibilities (: (List Text)
(list "text"
"program"
@@ -116,59 +116,59 @@
"other work"))]
($.paragraph (list (format "any " ($.or possibilities)
" created by " (get@ #term recipient)
- " which is required by a third party to successfully install and run a " (get@ #term derivative-work)
+ " which is required by a third party to successfully install and run a " (get@ #term derivative_work)
" by " (get@ #term recipient)))))]
[extension "Extension"
(let [possibilities (: (List Text)
(list (get@ #term modification)
- (get@ #term derivative-work)
- (get@ #term required-component)))]
+ (get@ #term derivative_work)
+ (get@ #term required_component)))]
($.paragraph (list (format "any " ($.or possibilities)))))]
[contribution "Contribution"
- ($.paragraph (list (format "any " covered-work-description ", including the original version of " (get@ #term work)
+ ($.paragraph (list (format "any " covered_work_description ", including the original version of " (get@ #term work)
" and any " (get@ #term extension) " to " (get@ #term work)
", that is intentionally communicated as a " (get@ #term submission)
" to " (get@ #term licensor)
" for inclusion in " (get@ #term work) " by the copyright owner"
- ", or by a " (get@ #term legal-entity) " authorized to submit on behalf of the copyright owner")))]
+ ", or by a " (get@ #term legal_entity) " authorized to submit on behalf of the copyright owner")))]
[contributor "Contributor"
($.paragraph (list (format (get@ #term licensor)
- " or any " (get@ #term legal-entity)
+ " or any " (get@ #term legal_entity)
" on behalf of whom a " (get@ #term contribution)
" has been received by " (get@ #term licensor)
", and subsequently incorporated within " (get@ #term work))))]
- [patent-claim (format "Patent Claim Of A " (get@ #term contributor))
- (let [claim-types (: (List Text)
+ [patent_claim (format "Patent Claim Of A " (get@ #term contributor))
+ (let [claim_types (: (List Text)
(list "method"
"process"
"apparatus"))]
- ($.paragraph (list (format "any patent claim(s), including without limitation " ($.and claim-types) " claims, in any patent "
+ ($.paragraph (list (format "any patent claim(s), including without limitation " ($.and claim_types) " claims, in any patent "
(get@ #term licensable) " by such " (get@ #term contributor)
" that would be infringed, but for the grant of " (get@ #term license)
- ", to " ($.or patent-rights) " its " (get@ #term contribution)))))]
+ ", to " ($.or patent_rights) " its " (get@ #term contribution)))))]
- [secondary-license "Secondary License"
+ [secondary_license "Secondary License"
($.paragraph (list (format "any license for which compliance does not imply or require violating the terms of " (get@ #term license))))]
[sell "Sell"
($.paragraph (list (format "practicing any or all of the rights granted to " (get@ #term recipient)
" under " (get@ #term license)
" to provide to third parties, for a fee or other consideration "
- "(including without limitation fees for " ($.or commercial-services)
+ "(including without limitation fees for " ($.or commercial_services)
" related to "(get@ #term work) ")"
", a product or service whose value derives, entirely or substantially, from the functionality of " (get@ #term work))))]
- [personal-use "Personal Use"
- (let [valid-purposes (: (List Text)
+ [personal_use "Personal Use"
+ (let [valid_purposes (: (List Text)
(list "personal"
"private"
"non-commercial"))]
- ($.paragraph (list (format "use of " (get@ #term work) " by an individual solely for his or her " ($.and valid-purposes) " purposes")
- (format "An individual's use of " (get@ #term work) " in his or her capacity as an " ($.or individual-capacities) " does not qualify"))))]
+ ($.paragraph (list (format "use of " (get@ #term work) " by an individual solely for his or her " ($.and valid_purposes) " purposes")
+ (format "An individual's use of " (get@ #term work) " in his or her capacity as an " ($.or individual_capacities) " does not qualify"))))]
[serve "Serve"
($.paragraph (list (format "to deliver " (get@ #term work)
@@ -180,36 +180,36 @@
($.paragraph (list (format "investigation or experimentation for the purpose of understanding the nature and limits of " (get@ #term work) " and its potential uses")))]
[deploy "Deploy"
- (let [deployment-types (: (List Text)
+ (let [deployment_types (: (List Text)
(list "use"
(get@ #term serve)
"sublicense"
"distribute"))
- sub-licensing (: (-> Text Text)
+ sub_licensing (: (-> Text Text)
(function (_ type)
(format type " sublicensing")))
- third-party-interactions (: (List Text)
- (list (sub-licensing "direct")
- (sub-licensing "indirect")
+ third_party_interactions (: (List Text)
+ (list (sub_licensing "direct")
+ (sub_licensing "indirect")
"distribution"))
- basic-definition (format "to " ($.or deployment-types)
+ basic_definition (format "to " ($.or deployment_types)
" " (get@ #term work)
" other than for internal " (get@ #term research)
- " and/or " (get@ #term personal-use)
+ " and/or " (get@ #term personal_use)
" by " (get@ #term recipient))
examples (format "any and all internal use or distribution of " (get@ #term work)
" within a business or organization in which " (get@ #term recipient)
" participates")
- exceptions (format "for " (get@ #term research) " and/or " (get@ #term personal-use))]
- ($.paragraph (list (format basic-definition
+ exceptions (format "for " (get@ #term research) " and/or " (get@ #term personal_use))]
+ ($.paragraph (list (format basic_definition
", and includes without limitation, " examples
", other than " exceptions
- ", as well as " ($.or third-party-interactions)
+ ", as well as " ($.or third_party_interactions)
" of " (get@ #term work)
" by " (get@ #term recipient)
" to any third party in any form or manner"))))]
- [electronic-distribution-mechanism "Electronic Distribution Mechanism"
+ [electronic_distribution_mechanism "Electronic Distribution Mechanism"
($.paragraph (list "a mechanism generally accepted in the software development community for the electronic transfer of data, such as download from an FTP server or web site, where such mechanism is publicly accessible"))]
)
@@ -217,24 +217,24 @@
(List Definition)
(list license
licensable
- legal-entity
+ legal_entity
recipient
licensor
- source-code-form
- object-form
+ source_code_form
+ object_form
work
- derivative-work
+ derivative_work
submission
modification
- required-component
+ required_component
extension
contribution
contributor
- patent-claim
- secondary-license
+ patent_claim
+ secondary_license
sell
- personal-use
+ personal_use
serve
research
deploy
- electronic-distribution-mechanism))
+ electronic_distribution_mechanism))
diff --git a/stdlib/source/program/licentia/license/distribution.lux b/licentia/source/program/licentia/license/distribution.lux
index f911623a0..8ec4e9bae 100644
--- a/stdlib/source/program/licentia/license/distribution.lux
+++ b/licentia/source/program/licentia/license/distribution.lux
@@ -23,90 +23,90 @@
(notices "limitation of liability")
(notices "other"))))
-(def: #export source-code-form
- (let [on-license-propagation (let [coverage (format "All distribution of " _.work " in " _.source-code-form)
- with-contributions (format "including any " ($.plural _.contribution)
+(def: #export source_code_form
+ (let [on_license_propagation (let [coverage (format "All distribution of " _.work " in " _.source_code_form)
+ with_contributions (format "including any " ($.plural _.contribution)
" that " _.recipient
" creates")
- same-license (format "must be under the terms of " _.license)]
- (format coverage ", " with-contributions ", " same-license))
- on-license-access (let [responsibility-to-inform (format _.recipient
- " must inform recipients that the " _.source-code-form
+ same_license (format "must be under the terms of " _.license)]
+ (format coverage ", " with_contributions ", " same_license))
+ on_license_access (let [responsibility_to_inform (format _.recipient
+ " must inform recipients that the " _.source_code_form
" of " _.work
" is governed by the terms of " _.license)
- license-copy (format "and how they can obtain a copy of " _.license)]
- (format responsibility-to-inform ", " license-copy))
- on-license-immutability (format _.recipient
- " may not attempt to alter or restrict the recipients’ rights in the " _.source-code-form
+ license_copy (format "and how they can obtain a copy of " _.license)]
+ (format responsibility_to_inform ", " license_copy))
+ on_license_immutability (format _.recipient
+ " may not attempt to alter or restrict the recipients’ rights in the " _.source_code_form
", as specified in " _.license)
- on-notice-retention (let [obligation (format _.recipient " must retain")
- location (format "in the " _.source-code-form
+ on_notice_retention (let [obligation (format _.recipient " must retain")
+ location (format "in the " _.source_code_form
" of any " _.extension
" that " _.recipient
" distributes")
- what (format "all " ($.and notices) " from the " _.source-code-form " of " _.work)
+ what (format "all " ($.and notices) " from the " _.source_code_form " of " _.work)
exclusion ($.or (list (format "those notices that do not pertain to any part of the " _.extension)
"those notices that contain known factual inaccuracies"))]
(format obligation ", " location ", " what ", excluding " exclusion))
- on-additional-notices (let [right (format _.recipient
+ on_additional_notices (let [right (format _.recipient
" may add additional "($.and notices)
" within an " _.extension
" that " _.recipient
" distributes")
constraint (format "such additional " ($.and notices) " cannot be construed as modifying " _.license)]
(format right ", provided that " constraint))]
- ($.paragraph (list on-license-propagation
- on-license-access
- on-license-immutability
- on-notice-retention
- on-additional-notices))))
+ ($.paragraph (list on_license_propagation
+ on_license_access
+ on_license_immutability
+ on_notice_retention
+ on_additional_notices))))
-(def: #export object-form
- (let [on-responsibility (let [condition (format "If " _.recipient
+(def: #export object_form
+ (let [on_responsibility (let [condition (format "If " _.recipient
" distributes " _.work
- " in " _.object-form)
- responsibility (let [availability-responsibility (format _.work " must also be made available in " _.source-code-form)
- source-code-responsibility (format _.recipient
- " must inform recipients of the " _.object-form
- " how they can obtain a copy of such " _.source-code-form)
+ " in " _.object_form)
+ responsibility (let [availability_responsibility (format _.work " must also be made available in " _.source_code_form)
+ source_code_responsibility (format _.recipient
+ " must inform recipients of the " _.object_form
+ " how they can obtain a copy of such " _.source_code_form)
constraints "by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient"]
- (format availability-responsibility ", and " source-code-responsibility " " constraints))]
+ (format availability_responsibility ", and " source_code_responsibility " " constraints))]
(format condition " then " responsibility))
- on-licensing (format _.recipient
- " may distribute such " _.object-form
+ on_licensing (format _.recipient
+ " may distribute such " _.object_form
" under the terms of "_.license)]
- ($.paragraph (list on-responsibility
- on-licensing))))
+ ($.paragraph (list on_responsibility
+ on_licensing))))
-(def: #export allow-re-licensing
- (let [can-license (format _.recipient
+(def: #export allow_re_licensing
+ (let [can_license (format _.recipient
" may create and distribute an " _.extension
" under terms " _.recipient
" chooses")
requirement (format _.recipient
" also comply with the requirements of " _.license
" for the " _.work)]
- (format can-license ", " "provided that " requirement)))
+ (format can_license ", " "provided that " requirement)))
-(def: #export allow-multi-licensing
- (let [condition (format "the " _.extension " is a combination of " _.work " with a work governed by one or more " ($.plural _.secondary-license))
+(def: #export allow_multi_licensing
+ (let [condition (format "the " _.extension " is a combination of " _.work " with a work governed by one or more " ($.plural _.secondary_license))
permission (let [relicensing (format _.license
" permits " _.recipient
" to additionally distribute " _.work
- " under the terms of such " ($.plural _.secondary-license))
+ " under the terms of such " ($.plural _.secondary_license))
distribution (format "so that the recipient of the " _.extension
" may, at their option, further distribute " _.work
" under the terms of either " _.license
- " or such " ($.plural _.secondary-license))]
+ " or such " ($.plural _.secondary_license))]
(format relicensing ", " distribution))]
(format "If " condition ", " permission)))
(def: #export (extension distribution)
(-> Distribution Text)
($.paragraph ($_ list\compose
- (if (get@ #//.can-re-license? distribution)
- (list allow-re-licensing)
+ (if (get@ #//.can_re_license? distribution)
+ (list allow_re_licensing)
(list))
- (if (get@ #//.can-multi-license? distribution)
- (list allow-multi-licensing)
+ (if (get@ #//.can_multi_license? distribution)
+ (list allow_multi_licensing)
(list)))))
diff --git a/stdlib/source/program/licentia/license/extension.lux b/licentia/source/program/licentia/license/extension.lux
index f808a8913..c6b368d33 100644
--- a/stdlib/source/program/licentia/license/extension.lux
+++ b/licentia/source/program/licentia/license/extension.lux
@@ -10,9 +10,9 @@
[//
["$" document]]])
-(def: #export sharing-requirement
+(def: #export sharing_requirement
(List Text)
- (let [on-extension (let [constraint (let [because "In consideration of, and as an express condition to, "
+ (let [on_extension (let [constraint (let [because "In consideration of, and as an express condition to, "
source (format "the licenses granted to " _.recipient
" under " _.license)]
(format because " " source))
@@ -22,55 +22,55 @@
" creates or to which " _.recipient
" contributes are governed by the terms of " _.license)]
(format constraint ", " duty))
- on-deployment (format _.recipient " may only " _.deploy
+ on_deployment (format _.recipient " may only " _.deploy
" an " _.extension
" that " _.recipient
" creates under the terms of " _.license)
- on-sharing (format _.recipient
+ on_sharing (format _.recipient
" hereby grant to " _.licensor
- " and all third parties a " ($.and grant.grant-characteristics)
+ " and all third parties a " ($.and grant.grant_characteristics)
" license under those intellectual property rights " _.recipient
- " owns or controls to " ($.or grant.copyright-grant-rights)
+ " owns or controls to " ($.or grant.copyright_grant_rights)
" " _.work
" in any form")
- on-license-propagation (format _.recipient
+ on_license_propagation (format _.recipient
" must include a copy of " _.license
" or directions on how to obtain a copy with every copy of an " _.extension
" " _.recipient " distributes")
- on-license-protection (format _.recipient
- " agrees not to offer or impose any terms on any " _.source-code-form
- " or " _.object-form
+ on_license_protection (format _.recipient
+ " agrees not to offer or impose any terms on any " _.source_code_form
+ " or " _.object_form
" of the " _.work
", or its " _.extension
" that alter or restrict the applicable version of " _.license
" or the recipients' rights hereunder")]
- (list on-extension
- on-deployment
- on-sharing
- on-license-propagation
- on-license-protection)))
+ (list on_extension
+ on_deployment
+ on_sharing
+ on_license_propagation
+ on_license_protection)))
-(def: #export license-conflict-resolution
+(def: #export license_conflict_resolution
(List Text)
- (let [on-other-licenses (let [circumstance (format "Where any portion of an " _.extension
+ (let [on_other_licenses (let [circumstance (format "Where any portion of an " _.extension
" created by " _.recipient)
consequence "fall under the terms of another license"
duty "the terms of that license should be honored"]
(format circumstance " " consequence ", " duty))
- on-this-license (format "However " _.recipient
+ on_this_license (format "However " _.recipient
" must also make the " _.extension
" available under " _.license)
- on-licensor-judgement (let [condition (format "the terms of " _.license " continue to conflict with the terms of the other license")
+ on_licensor_judgement (let [condition (format "the terms of " _.license " continue to conflict with the terms of the other license")
right (format _.recipient " may write " _.licensor " for permission to resolve the conflict")
characteristic (format "a fashion that remains consistent with the intent of " _.license)]
(format "If " condition ", " right " in " characteristic))
- on-licensor-discretion (format "Such permission will be granted at the sole discretion of " _.licensor)]
- (list on-other-licenses
- on-this-license
- on-licensor-judgement
- on-licensor-discretion)))
+ on_licensor_discretion (format "Such permission will be granted at the sole discretion of " _.licensor)]
+ (list on_other_licenses
+ on_this_license
+ on_licensor_judgement
+ on_licensor_discretion)))
-(def: #export distinctness-requirement
+(def: #export distinctness_requirement
($.paragraph (list (format "Any " _.extension
" " _.recipient
" does make and " _.deploy
@@ -78,72 +78,72 @@
" that the " _.extension
" is by " _.recipient))))
-(def: news-sources
+(def: news_sources
(List Text)
(list "news groups"
"mailing lists"
"weblogs"
"other sites"))
-(def: #export (notification-requirement [start end])
+(def: #export (notification_requirement [start end])
(-> (Period Months) Text)
- (let [on-availability (format _.recipient
- " must notify the software community of the availability of the " _.source-code-form
+ (let [on_availability (format _.recipient
+ " must notify the software community of the availability of the " _.source_code_form
" to any " _.extension
" created by " _.recipient
" within " (%.nat start)
" month(s) of the date " _.recipient
" initially does " _.deploy
", and include in such notification a description of the " _.extension
- ", and instructions on how to acquire the " _.source-code-form
- " via an " _.electronic-distribution-mechanism)
- on-duration (format "The " _.source-code-form
- " must remain available via an " _.electronic-distribution-mechanism
+ ", and instructions on how to acquire the " _.source_code_form
+ " via an " _.electronic_distribution_mechanism)
+ on_duration (format "The " _.source_code_form
+ " must remain available via an " _.electronic_distribution_mechanism
" for no less than " (%.nat end)
" month(s) after the date " _.recipient
" ceases to " _.deploy)
- on-responsibility (format _.recipient
- " is responsible for ensuring that the " _.source-code-form
+ on_responsibility (format _.recipient
+ " is responsible for ensuring that the " _.source_code_form
" to each " _.extension
" " _.recipient
" does " _.deploy
- " remains available even if the " _.electronic-distribution-mechanism
+ " remains available even if the " _.electronic_distribution_mechanism
" is maintained by a third party")
- on-costs (format _.recipient
- " may not charge a fee for any copy of the " _.source-code-form
+ on_costs (format _.recipient
+ " may not charge a fee for any copy of the " _.source_code_form
" in excess of the actual cost of duplication and distribution of said copy that " _.recipient
" incurs")
- on-changes (format "Should such instructions change, " _.recipient
+ on_changes (format "Should such instructions change, " _.recipient
" must notify the software community of revised instructions within " (%.nat start)
" month(s) of the date of change")
- on-accesibility (format _.recipient
- " must provide notification by posting to appropriate " ($.or news-sources)
+ on_accesibility (format _.recipient
+ " must provide notification by posting to appropriate " ($.or news_sources)
" where a publicly accessible search engine would reasonably be expected to index a post in relationship to queries regarding " _.work
" and/or an " _.extension
" created by " _.recipient)]
- ($.paragraph (list on-availability
- on-duration
- on-responsibility
- on-costs
- on-changes
- on-accesibility))))
+ ($.paragraph (list on_availability
+ on_duration
+ on_responsibility
+ on_costs
+ on_changes
+ on_accesibility))))
-(def: #export description-requirement
+(def: #export description_requirement
Text
- (let [on-duty (let [basic (format _.recipient
+ (let [on_duty (let [basic (format _.recipient
" must cause any " _.modification
" that " _.recipient
" creates, or to which " _.recipient
- " contributes, to be documented in the " _.source-code-form)
- modification-types (: (List Text)
+ " contributes, to be documented in the " _.source_code_form)
+ modification_types (: (List Text)
(list "additions"
"changes"
"deletions"))
- details (format "clearly describing the " ($.and modification-types)
+ details (format "clearly describing the " ($.and modification_types)
" that " _.recipient " made")]
(format basic ", " details))
- on-notice-location (let [statement-locations (: (List Text)
- (list (format "in the " _.source-code-form)
+ on_notice_location (let [statement_locations (: (List Text)
+ (list (format "in the " _.source_code_form)
(format "in any notice displayed by " _.work
" " _.recipient
" distributes")
@@ -155,12 +155,12 @@
" and include the names of " _.licensor
" and any " _.contributor
" to " _.work
- " " ($.and statement-locations)))
- on-notice-preservation (format _.recipient
+ " " ($.and statement_locations)))
+ on_notice_preservation (format _.recipient
" may not modify or delete any pre-existing copyright notices, change notices or the text of " _.license
" in " _.work
" without written permission of " _.licensor
" or the respective " _.contributor)]
- ($.paragraph (list on-duty
- on-notice-location
- on-notice-preservation))))
+ ($.paragraph (list on_duty
+ on_notice_location
+ on_notice_preservation))))
diff --git a/stdlib/source/program/licentia/license/grant.lux b/licentia/source/program/licentia/license/grant.lux
index 0f45f3592..c79fcee09 100644
--- a/stdlib/source/program/licentia/license/grant.lux
+++ b/licentia/source/program/licentia/license/grant.lux
@@ -10,12 +10,12 @@
[//
["$" document]]])
-(def: grant-header
+(def: grant_header
(format "Subject to the terms and conditions of " _.license
", each " _.contributor
" hereby grants to " _.recipient))
-(def: #export grant-characteristics
+(def: #export grant_characteristics
(List Text)
(list "perpetual"
"world-wide"
@@ -24,7 +24,7 @@
"royalty-free"
"irrevocable"))
-(def: #export copyright-grant-rights
+(def: #export copyright_grant_rights
(List Text)
(list "use"
"reproduce"
@@ -36,23 +36,23 @@
"distribute"))
(def: #export copyright
- ($.sentence (format grant-header " a " ($.and ..grant-characteristics)
- " copyright license to " ($.or ..copyright-grant-rights)
+ ($.sentence (format grant_header " a " ($.and ..grant_characteristics)
+ " copyright license to " ($.or ..copyright_grant_rights)
" " _.work
" and such an " _.extension
- " in a " _.source-code-form
- " or an " _.object-form)))
+ " in a " _.source_code_form
+ " or an " _.object_form)))
(def: #export (patent retaliation?)
(-> Bit Text)
- (let [grant (format grant-header " a " ($.and ..grant-characteristics)
- " patent license to " ($.or definition.patent-rights) " "
+ (let [grant (format grant_header " a " ($.and ..grant_characteristics)
+ " patent license to " ($.or definition.patent_rights) " "
_.work
- ", where such license applies only to any " _.patent-claim
+ ", where such license applies only to any " _.patent_claim
" that is necessarily infringed by their " ($.plural _.contribution)
" alone or by combination of their " ($.plural _.contribution)
" with " _.work)
- retaliation-clause (format "If " _.recipient " institutes patent litigation against any " _.legal-entity
+ retaliation_clause (format "If " _.recipient " institutes patent litigation against any " _.legal_entity
" (including a cross-claim or counterclaim in a lawsuit) alleging that "
_.work " or a " _.contribution
" incorporated within " _.work " constitutes direct or contributory patent infringement"
@@ -62,7 +62,7 @@
" shall terminate as of the date such litigation is filed")]
($.paragraph (list& grant
(if retaliation?
- (list retaliation-clause)
+ (list retaliation_clause)
(list))))))
(def: #export date
@@ -72,53 +72,53 @@
" on the date the " _.contributor
" first distributes such " _.contribution)))
-(def: restoration-scope "an ongoing basis")
+(def: restoration_scope "an ongoing basis")
-(def: #export (grant-restoration-clause termination-period)
+(def: #export (grant_restoration_clause termination_period)
(-> Days Text)
- (let [restoration-condition (format _.recipient " becomes compliant")
- restored-grants (format "the rights granted under " _.license
+ (let [restoration_condition (format _.recipient " becomes compliant")
+ restored_grants (format "the rights granted under " _.license
" from a particular " _.contributor)
- invalidation-condition (format "such " _.contributor
+ invalidation_condition (format "such " _.contributor
" explicitly and finally terminates the grants to " _.recipient)
- complaint-period-condition (format "such " _.contributor
+ complaint_period_condition (format "such " _.contributor
" fails to notify " _.recipient
- " of the non-compliance by some reasonable means prior to " (%.nat termination-period)
+ " of the non-compliance by some reasonable means prior to " (%.nat termination_period)
" " ($.plural "day") " after " _.recipient
" has come back into compliance")]
- (format "However, if " restoration-condition ", then " restored-grants " are reinstated provisionally"
- ", unless and until " invalidation-condition
- ", and on " ..restoration-scope ", if " complaint-period-condition)))
+ (format "However, if " restoration_condition ", then " restored_grants " are reinstated provisionally"
+ ", unless and until " invalidation_condition
+ ", and on " ..restoration_scope ", if " complaint_period_condition)))
-(def: #export (grace-period-clause grace-period)
+(def: #export (grace_period_clause grace_period)
(-> Days Text)
- (let [the-grants (format "grants to " _.recipient " from a particular " _.contributor)
- automatic-restoration-conditions (let [notification (format "such " _.contributor
+ (let [the_grants (format "grants to " _.recipient " from a particular " _.contributor)
+ automatic_restoration_conditions (let [notification (format "such " _.contributor
" notifies " _.recipient
" of the non-compliance by some reasonable means")
- first-offense (format "this is the first time " _.recipient
+ first_offense (format "this is the first time " _.recipient
" has received notice of non-compliance with " _.license
" from such " _.contributor)
- prompt-compliance (format _.recipient
- " becomes compliant prior to " (%.nat grace-period)
+ prompt_compliance (format _.recipient
+ " becomes compliant prior to " (%.nat grace_period)
" " ($.plural "day") " after reception of the notice")]
($.and (list notification
- first-offense
- prompt-compliance)))]
- (format "Moreover, " the-grants
- " are reinstated on " ..restoration-scope
- " if " automatic-restoration-conditions)))
+ first_offense
+ prompt_compliance)))]
+ (format "Moreover, " the_grants
+ " are reinstated on " ..restoration_scope
+ " if " automatic_restoration_conditions)))
-(def: #export (termination termination-period grace-period)
+(def: #export (termination termination_period grace_period)
(-> Days Days Text)
- (let [on-violation-of-terms (let [what (format "The rights granted under " _.license)
+ (let [on_violation_of_terms (let [what (format "The rights granted under " _.license)
when (format _.recipient " fails to comply with any of its terms")]
(format what " will terminate automatically if " when))]
- ($.paragraph (list on-violation-of-terms
- (..grant-restoration-clause termination-period)
- (..grace-period-clause grace-period)))))
+ ($.paragraph (list on_violation_of_terms
+ (..grant_restoration_clause termination_period)
+ (..grace_period_clause grace_period)))))
-(def: #export no-retroactive-termination
+(def: #export no_retroactive_termination
(let [situation "In the event of termination"
coverage "all end user license agreements"
exclusions "(excluding licenses to distributors and resellers)"
diff --git a/stdlib/source/program/licentia/license/liability.lux b/licentia/source/program/licentia/license/liability.lux
index 51b98ad40..1ad88c43d 100644
--- a/stdlib/source/program/licentia/license/liability.lux
+++ b/licentia/source/program/licentia/license/liability.lux
@@ -8,13 +8,13 @@
[//
["$" document]]])
-(def: warranty-communications
+(def: warranty_communications
(List Text)
(list "expressed"
"implied"
"statutory"))
-(def: work-disclamers
+(def: work_disclamers
(List Text)
(list "free of defects"
"merchantable"
@@ -28,38 +28,38 @@
"correction"))
(def: #export warranty
- (let [on-basics (let [applicability-escape "Unless required by applicable law or agreed to in writing"
- work-provisioning (format _.licensor
+ (let [on_basics (let [applicability_escape "Unless required by applicable law or agreed to in writing"
+ work_provisioning (format _.licensor
" provides " _.work
", and each " _.contributor
" provides its " ($.plural _.contribution))]
- (format applicability-escape ", "
- work-provisioning
+ (format applicability_escape ", "
+ work_provisioning
" under " _.license
" on an " ($.quote "as is")
- " basis, without warranty or condition of any kind, either " ($.or warranty-communications)
+ " basis, without warranty or condition of any kind, either " ($.or warranty_communications)
" including, without limitation, any warranties or conditions that " _.work
- " is " ($.or work-disclamers)))
- on-distribution (format _.recipient
+ " is " ($.or work_disclamers)))
+ on_distribution (format _.recipient
" is solely responsible for determining the appropriateness of using or redistributing " _.work)
- on-risk (format "The entire risk as to the quality and performance of " _.work
+ on_risk (format "The entire risk as to the quality and performance of " _.work
" is with " _.recipient)
- on-fixes (format "Should " _.work
+ on_fixes (format "Should " _.work
" prove defective in any respect, " _.recipient
", not any " _.contributor
", assumes the cost of any necessary " ($.or fixes))
- on-importance (format "This disclaimer of warranty constitutes an essential part of "_.license)
- on-authorization (format "No use of "_.work
+ on_importance (format "This disclaimer of warranty constitutes an essential part of "_.license)
+ on_authorization (format "No use of "_.work
" is authorized under " _.license
" except under this disclaimer")]
- ($.paragraph (list on-basics
- on-distribution
- on-risk
- on-fixes
- on-importance
- on-authorization))))
+ ($.paragraph (list on_basics
+ on_distribution
+ on_risk
+ on_fixes
+ on_importance
+ on_authorization))))
-(def: damage-types
+(def: damage_types
(List Text)
(list "direct"
"indirect"
@@ -67,7 +67,7 @@
"incidental"
"consequential"))
-(def: damage-consequences
+(def: damage_consequences
(List Text)
(list "lost profits"
"loss of goodwill"
@@ -76,30 +76,30 @@
"any and all other commercial damages or losses"))
(def: #export limitation
- (let [on-limit (let [exclusion "Under no circumstances and under no legal theory"
+ (let [on_limit (let [exclusion "Under no circumstances and under no legal theory"
examples "whether tort (including negligence), contract, or otherwise"
- applicable-law-exception "unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing"
+ applicable_law_exception "unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing"
renunciation (format "shall any " _.contributor
" be liable to " _.recipient)
- damage-enumeration (format "for any " ($.or damage-types) " damages of any character"
- " including without limitation damages for " ($.or damage-consequences))
+ damage_enumeration (format "for any " ($.or damage_types) " damages of any character"
+ " including without limitation damages for " ($.or damage_consequences))
conscience "even if such party shall have been informed of the possibility of such damages"]
- (format exclusion ", " examples ", " applicable-law-exception ", " renunciation " " damage-enumeration ", " conscience))
- on-death-exception "This limitation of liability shall not apply to liability for death or personal injury resulting from such party’s negligence to the extent applicable law prohibits such limitation"
- on-jurisdictions (format "Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to " _.recipient)]
- ($.paragraph (list on-limit
- on-death-exception
- on-jurisdictions))))
+ (format exclusion ", " examples ", " applicable_law_exception ", " renunciation " " damage_enumeration ", " conscience))
+ on_death_exception "This limitation of liability shall not apply to liability for death or personal injury resulting from such party’s negligence to the extent applicable law prohibits such limitation"
+ on_jurisdictions (format "Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to " _.recipient)]
+ ($.paragraph (list on_limit
+ on_death_exception
+ on_jurisdictions))))
(def: #export litigation
- (let [on-jurisdiction (format "Any litigation relating to " _.license " may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business")
- on-laws "Such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions"
- on-claims "Nothing in this section shall prevent a party’s ability to bring cross-claims or counter-claims"]
- ($.paragraph (list on-jurisdiction
- on-laws
- on-claims))))
+ (let [on_jurisdiction (format "Any litigation relating to " _.license " may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business")
+ on_laws "Such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions"
+ on_claims "Nothing in this section shall prevent a party’s ability to bring cross-claims or counter-claims"]
+ ($.paragraph (list on_jurisdiction
+ on_laws
+ on_claims))))
-(def: liability-obligations
+(def: liability_obligations
(List Text)
(list "support"
"warranty"
@@ -107,34 +107,34 @@
"other liability obligations"
(format "rights consistent with " _.license)))
-(def: #export can-accept
- (let [on-acceptance-of-liability (let [condition (format "While redistributing " _.work " or " ($.plural _.extension) " thereof")
- right (format _.recipient " may choose to offer, and charge a fee for, acceptance of " ($.and/or ..liability-obligations))]
+(def: #export can_accept
+ (let [on_acceptance_of_liability (let [condition (format "While redistributing " _.work " or " ($.plural _.extension) " thereof")
+ right (format _.recipient " may choose to offer, and charge a fee for, acceptance of " ($.and/or ..liability_obligations))]
(format condition ", " right))
- on-responsibility (let [but "However, in accepting such obligations"
- cannot-represent-a-contributor (format _.recipient " may not act on behalf of any other " _.contributor)
- can-only-represent-oneself (format "only on behalf and on sole responsibility of " _.recipient)
- each-contributor (: (-> Text Text)
+ on_responsibility (let [but "However, in accepting such obligations"
+ cannot_represent_a_contributor (format _.recipient " may not act on behalf of any other " _.contributor)
+ can_only_represent_oneself (format "only on behalf and on sole responsibility of " _.recipient)
+ each_contributor (: (-> Text Text)
(function (_ responsibility)
(format responsibility " each " _.contributor)))
responsibilities (: (List Text)
- (list (each-contributor "indemnify")
- (each-contributor "defend")
- (format (each-contributor "hold") " harmless")))
- full-responsibility-condition (format "and only if " _.recipient
+ (list (each_contributor "indemnify")
+ (each_contributor "defend")
+ (format (each_contributor "hold") " harmless")))
+ full_responsibility_condition (format "and only if " _.recipient
" agrees to " ($.and responsibilities)
" for any liability incurred by, or claims asserted against, such " _.contributor
" by reason of acceptance of any such warranty or additional liability by " _.recipient)]
- (format but ", " cannot-represent-a-contributor ", " can-only-represent-oneself ", " full-responsibility-condition))]
- ($.paragraph (list on-acceptance-of-liability
- on-responsibility))))
+ (format but ", " cannot_represent_a_contributor ", " can_only_represent_oneself ", " full_responsibility_condition))]
+ ($.paragraph (list on_acceptance_of_liability
+ on_responsibility))))
-(def: #export disclaim-high-risk
- (let [on-work (let [intentions (: (List Text)
+(def: #export disclaim_high_risk
+ (let [on_work (let [intentions (: (List Text)
(list "designed"
"manufactured"
"intended for use or distribution"))
- hazardous-environments (: (List Text)
+ hazardous_environments (: (List Text)
(list "nuclear facilities"
"aircraft navigation"
"communications systems"
@@ -149,12 +149,12 @@
disclaim (format _.work " is not fault tolerant"
", and is not " ($.or intentions)
" as on-line control equipment in hazardous environments requiring fail-safe performance")
- examples (format "such as in the operation of " ($.or hazardous-environments))
+ examples (format "such as in the operation of " ($.or hazardous_environments))
further (format "in which the failure of " _.work " could lead directly to " ($.or consequences))]
(format disclaim ", " examples ", " further))
- on-contributors (let [claim "any express or implied warranty of fitness for high risk activities"]
+ on_contributors (let [claim "any express or implied warranty of fitness for high risk activities"]
(format _.licensor
" and every " _.contributor
" specifically disclaim " claim))]
- ($.paragraph (list on-work
- on-contributors))))
+ ($.paragraph (list on_work
+ on_contributors))))
diff --git a/stdlib/source/program/licentia/license/limitation.lux b/licentia/source/program/licentia/license/limitation.lux
index 1617d9909..046e60a55 100644
--- a/stdlib/source/program/licentia/license/limitation.lux
+++ b/licentia/source/program/licentia/license/limitation.lux
@@ -26,25 +26,25 @@
" permission to " ($.or abilities))
warning (format "These actions are prohibited by law if " _.recipient
" does not accept " _.license)
- implicit-acceptance (let [activation-condition "by performing any of these actions"
+ implicit_acceptance (let [activation_condition "by performing any of these actions"
acceptance (format _.recipient
" indicates that " _.recipient
" accepts " _.license)
agreement (format _.recipient " agrees to be bound by all its terms and conditions")]
- (format "Therefore, " activation-condition ", " ($.and (list acceptance agreement))))
- prohibition-due-to-non-agreement (format "If " _.recipient
+ (format "Therefore, " activation_condition ", " ($.and (list acceptance agreement))))
+ prohibition_due_to_non_agreement (format "If " _.recipient
" does not agree with all the terms and conditions of " _.license
", " _.recipient " can not " ($.or abilities))
- prohibition-due-to-impossibility (format "If it is impossible for " _.recipient
+ prohibition_due_to_impossibility (format "If it is impossible for " _.recipient
" to comply with all the terms and conditions of " _.license
", then " _.recipient
" can not " ($.or abilities))]
($.paragraph (list acknowledgement
limitation
warning
- implicit-acceptance
- prohibition-due-to-non-agreement
- prohibition-due-to-impossibility))))
+ implicit_acceptance
+ prohibition_due_to_non_agreement
+ prohibition_due_to_impossibility))))
(def: #export grant
($.paragraph (list (format "The licenses granted in this document are the only rights granted under " _.license)
@@ -68,8 +68,8 @@
"; except as required for reasonable and customary use in describing the origin of "
_.work))))
-(def: #export secondary-licenses
+(def: #export secondary_licenses
($.paragraph (list (format "No " _.contributor
" makes additional grants as a result of a choice by " _.recipient
" to distribute " _.work
- " under a under the terms of a " _.secondary-license))))
+ " under a under the terms of a " _.secondary_license))))
diff --git a/stdlib/source/program/licentia/license/miscellaneous.lux b/licentia/source/program/licentia/license/miscellaneous.lux
index 03adb1462..0fbc96982 100644
--- a/stdlib/source/program/licentia/license/miscellaneous.lux
+++ b/licentia/source/program/licentia/license/miscellaneous.lux
@@ -8,29 +8,29 @@
[//
["$" document]]])
-(def: #export entire-agreement
+(def: #export entire_agreement
($.paragraph (list (format _.license " constitutes the entire agreement between the parties with respect to the subject matter hereof"))))
-(def: #export relationship-of-parties
- (let [legal-associations (: (List Text)
+(def: #export relationship_of_parties
+ (let [legal_associations (: (List Text)
(list "an agency"
"a partnership"
"a joint venture"
"any other form of legal association"))
- forms-of-representation (: (List Text)
+ forms_of_representation (: (List Text)
(list "expressly"
"by implication"
"by appearance"
"otherwise"))
- disclaimer (format _.license " will not be construed as creating " ($.or legal-associations))
+ disclaimer (format _.license " will not be construed as creating " ($.or legal_associations))
scope (format "between or among " _.recipient
", " _.licensor
" or any " _.contributor)
constraint (format _.recipient
- " will not represent to the contrary, whether " ($.or forms-of-representation))]
+ " will not represent to the contrary, whether " ($.or forms_of_representation))]
($.paragraph (list (format disclaimer " " scope ", and " constraint)))))
-(def: #export independent-development
+(def: #export independent_development
(let [actions (: (List Text)
(list "acquire"
"license"
@@ -53,7 +53,7 @@
" that " _.recipient
" may " ($.or actions))))))
-(def: #export not-waiver
+(def: #export not_waiver
(let [culprits (format _.licensor " or any " _.contributor)
duty (format "enforce any provision of " _.license)
effect "a waiver of future enforcement of that or any other provision"]
@@ -62,45 +62,45 @@
" will not be deemed " effect)))))
(def: #export severability
- (let [on-reformation (format "If any provision of " _.license " is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable")
- on-contributor-protection (format "Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe " _.license
+ (let [on_reformation (format "If any provision of " _.license " is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable")
+ on_contributor_protection (format "Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe " _.license
" against a " _.contributor)]
- ($.paragraph (list on-reformation
- on-contributor-protection))))
+ ($.paragraph (list on_reformation
+ on_contributor_protection))))
-(def: #export export-restrictions
+(def: #export export_restrictions
(let [limiter "applicable laws and regulations"
limited (: (List Text)
(list "downloading"
"acquiring"
"exporting"
"reexporting"))
- on-circumstances (let [limitation (format _.recipient
+ on_circumstances (let [limitation (format _.recipient
" may be restricted with respect to " ($.or limited))
target (format _.work " or any underlying information or technology")]
(format limitation " " target " by " limiter))
- on-acceptance-of-responsibility (let [trigger (format "By " ($.or limited) " " _.work)
+ on_acceptance_of_responsibility (let [trigger (format "By " ($.or limited) " " _.work)
agreement (format _.recipient
" is agreeing to be responsible for compliance with all " limiter)]
(format trigger ", " agreement))]
- ($.paragraph (list on-circumstances
- on-acceptance-of-responsibility))))
+ ($.paragraph (list on_circumstances
+ on_acceptance_of_responsibility))))
-(def: #export new-versions
- (let [on-publishing (let [when ", from time to time,"
+(def: #export new_versions
+ (let [on_publishing (let [when ", from time to time,"
what (format "revised versions of " _.license)]
(format _.licensor " may publish" when " " what))
- on-published-version-validity (let [condition (format _.work " has been published under a particular version of " _.license)
+ on_published_version_validity (let [condition (format _.work " has been published under a particular version of " _.license)
effect (format _.recipient " may always continue to use it under the terms of that version")]
(format "Once " condition ", " effect))
- on-license-upgrading (format _.recipient
+ on_license_upgrading (format _.recipient
" may also choose to use " _.work
" under the terms of any subsequent version of " _.license
" published by " _.licensor)
- on-licensor-privilege (format "No one other than " _.licensor
+ on_licensor_privilege (format "No one other than " _.licensor
" has the right to modify the terms applicable to " _.work
" created under " _.license)]
- ($.paragraph (list on-publishing
- on-published-version-validity
- on-license-upgrading
- on-licensor-privilege))))
+ ($.paragraph (list on_publishing
+ on_published_version_validity
+ on_license_upgrading
+ on_licensor_privilege))))
diff --git a/stdlib/source/program/licentia/license/notice.lux b/licentia/source/program/licentia/license/notice.lux
index 219af97f4..7ee61397a 100644
--- a/stdlib/source/program/licentia/license/notice.lux
+++ b/licentia/source/program/licentia/license/notice.lux
@@ -1,12 +1,13 @@
(.module:
[lux #*
[data
- [number
- ["n" nat]]
["." text
["%" format (#+ format)]]
[collection
- ["." list ("#\." functor)]]]]
+ ["." list ("#\." functor)]]]
+ [math
+ [number
+ ["n" nat]]]]
["." // #_
["#." time]
["#." copyright]
@@ -14,19 +15,19 @@
[//
["$" document]]])
-(def: #export end-of-license
+(def: #export end_of_license
($.sentence "END OF TERMS AND CONDITIONS"))
-(def: #export (copyright-holder holder)
+(def: #export (copyright_holder holder)
(-> //copyright.Holder Text)
(let [(^slots [#//time.start #//time.end]) (get@ #//copyright.period holder)
- single-year? (n.= start end)
- period-section (if single-year?
+ single_year? (n.= start end)
+ period_section (if single_year?
(%.nat start)
(format (%.nat start) "-" (%.nat end)))]
- (format "Copyright (C) " period-section " " (get@ #//copyright.name holder))))
+ (format "Copyright (C) " period_section " " (get@ #//copyright.name holder))))
(def: #export copyright
(-> (List //copyright.Holder) Text)
- (|>> (list\map ..copyright-holder)
- (text.join-with text.new-line)))
+ (|>> (list\map ..copyright_holder)
+ (text.join_with text.new_line)))
diff --git a/stdlib/source/program/licentia/license/submission.lux b/licentia/source/program/licentia/license/submission.lux
index 855141690..855141690 100644
--- a/stdlib/source/program/licentia/license/submission.lux
+++ b/licentia/source/program/licentia/license/submission.lux
diff --git a/stdlib/source/program/licentia/license/term.lux b/licentia/source/program/licentia/license/term.lux
index 54b3b1cc4..c9db7fa5a 100644
--- a/stdlib/source/program/licentia/license/term.lux
+++ b/licentia/source/program/licentia/license/term.lux
@@ -8,27 +8,27 @@
Text
(get@ #//definition.term <definition>))]
- [source-code-form //definition.source-code-form]
- [object-form //definition.object-form]
+ [source_code_form //definition.source_code_form]
+ [object_form //definition.object_form]
[license //definition.license]
[licensable //definition.licensable]
- [legal-entity //definition.legal-entity]
+ [legal_entity //definition.legal_entity]
[recipient //definition.recipient]
[licensor //definition.licensor]
[work //definition.work]
- [derivative-work //definition.derivative-work]
+ [derivative_work //definition.derivative_work]
[submission //definition.submission]
[modification //definition.modification]
- [required-component //definition.required-component]
+ [required_component //definition.required_component]
[extension //definition.extension]
[contribution //definition.contribution]
[contributor //definition.contributor]
- [patent-claim //definition.patent-claim]
- [secondary-license //definition.secondary-license]
+ [patent_claim //definition.patent_claim]
+ [secondary_license //definition.secondary_license]
[sell //definition.sell]
- [personal-use //definition.personal-use]
+ [personal_use //definition.personal_use]
[serve //definition.serve]
[research //definition.research]
[deploy //definition.deploy]
- [electronic-distribution-mechanism //definition.electronic-distribution-mechanism]
+ [electronic_distribution_mechanism //definition.electronic_distribution_mechanism]
)
diff --git a/stdlib/source/program/licentia/license/time.lux b/licentia/source/program/licentia/license/time.lux
index 22f28f607..22f28f607 100644
--- a/stdlib/source/program/licentia/license/time.lux
+++ b/licentia/source/program/licentia/license/time.lux
diff --git a/stdlib/source/program/licentia/output.lux b/licentia/source/program/licentia/output.lux
index fdbd9accd..691612b6e 100644
--- a/stdlib/source/program/licentia/output.lux
+++ b/licentia/source/program/licentia/output.lux
@@ -13,7 +13,7 @@
Distribution
Commercial
Extension
- Entity Black-List
+ Entity Black_List
URL Attribution
License)
["." copyright]
@@ -27,7 +27,7 @@
["." extension]
["." submission]
["." miscellaneous]
- ["." black-list]
+ ["." black_list]
["." notice]
["_" term]
["." addendum]]
@@ -39,7 +39,7 @@
(def: #export (identification value)
(-> Identification Text)
- (format (get@ #license.name value) text.new-line
+ (format (get@ #license.name value) text.new_line
(get@ #license.version value)))
(def: #export (grant termination)
@@ -52,17 +52,17 @@
grant.copyright]
["Grant of Patent License"
- (grant.patent (get@ #license.patent-retaliation? termination))]
+ (grant.patent (get@ #license.patent_retaliation? termination))]
["Effective Date for the Grants"
grant.date]
["Grant Termination"
- (grant.termination (get@ #license.termination-period termination)
- (get@ #license.grace-period termination))]
+ (grant.termination (get@ #license.termination_period termination)
+ (get@ #license.grace_period termination))]
["No Retroactive Effect of Termination"
- grant.no-retroactive-termination])))))
+ grant.no_retroactive_termination])))))
(def: #export limitation
Text
@@ -76,8 +76,8 @@
["Limitations on Trademarks"
limitation.trademark]
- [(format "Limitations on " ($.plural _.secondary-license))
- limitation.secondary-licenses])))))
+ [(format "Limitations on " ($.plural _.secondary_license))
+ limitation.secondary_licenses])))))
(def: #export assurance
Text
@@ -89,7 +89,7 @@
assurance.representation]
["Fair Use"
- assurance.fair-use])))))
+ assurance.fair_use])))))
(def: #export (liability value)
(-> Liability Text)
@@ -112,12 +112,12 @@
liability.litigation]
["Accepting Warranty or Additional Liability"
- (get@ #license.can-accept? value)
- liability.can-accept]
+ (get@ #license.can_accept? value)
+ liability.can_accept]
["High Risk Activities"
- (get@ #license.disclaim-high-risk? value)
- liability.disclaim-high-risk])))))
+ (get@ #license.disclaim_high_risk? value)
+ liability.disclaim_high_risk])))))
(def: #export (distribution distribution)
(-> Distribution Text)
@@ -127,17 +127,17 @@
#$.content <content>}))
"")]
- [(format "Distribution of a " _.source-code-form)
+ [(format "Distribution of a " _.source_code_form)
on
- distribution.source-code-form]
+ distribution.source_code_form]
- [(format "Distribution of an " _.object-form)
+ [(format "Distribution of an " _.object_form)
on
- distribution.object-form]
+ distribution.object_form]
[(format "Distribution of an " _.extension)
- (or (get@ #license.can-re-license? distribution)
- (get@ #license.can-multi-license? distribution))
+ (or (get@ #license.can_re_license? distribution)
+ (get@ #license.can_multi_license? distribution))
(distribution.extension distribution)])))))
(def: #export (commercial value)
@@ -149,23 +149,23 @@
"")]
["Non-Commerciality"
- (not (get@ #license.can-sell? value))
- commercial.cannot-sell]
+ (not (get@ #license.can_sell? value))
+ commercial.cannot_sell]
[(format _.contributor " Attribution")
- (get@ #license.require-contributor-credit? value)
- commercial.require-contributor-attribution]
+ (get@ #license.require_contributor_credit? value)
+ commercial.require_contributor_attribution]
[(format _.contributor " Endorsement")
- (not (get@ #license.allow-contributor-endorsement? value))
- commercial.disallow-contributor-endorsement]
+ (not (get@ #license.allow_contributor_endorsement? value))
+ commercial.disallow_contributor_endorsement]
)))))
(def: #export (extension value)
(-> Extension Text)
- (let [[show? document] (case (get@ #license.notification-period value)
+ (let [[show? document] (case (get@ #license.notification_period value)
(#.Some period)
- [true (extension.notification-requirement period)]
+ [true (extension.notification_requirement period)]
#.None
[false ""])]
@@ -175,36 +175,36 @@
#$.content <content>}))
"")]
- [(get@ #license.same-license? value) "License Retention"
- ($.paragraph (list\compose extension.sharing-requirement
- extension.license-conflict-resolution))]
+ [(get@ #license.same_license? value) "License Retention"
+ ($.paragraph (list\compose extension.sharing_requirement
+ extension.license_conflict_resolution))]
- [(get@ #license.must-be-distinguishable? value) (format _.extension " Distinctness")
- extension.distinctness-requirement]
+ [(get@ #license.must_be_distinguishable? value) (format _.extension " Distinctness")
+ extension.distinctness_requirement]
- [show? (format _.source-code-form " Availability")
+ [show? (format _.source_code_form " Availability")
document]
- [(get@ #license.must-describe-modifications? value) (format "Description of " ($.plural _.modification))
- extension.description-requirement]))))))
+ [(get@ #license.must_describe_modifications? value) (format "Description of " ($.plural _.modification))
+ extension.description_requirement]))))))
(def: #export (attribution value)
(-> Attribution Text)
- (let [copyright-notice (format "Attribution Copyright Notice: " (get@ #license.copyright-notice value))
+ (let [copyright_notice (format "Attribution Copyright Notice: " (get@ #license.copyright_notice value))
phrase (case (get@ #license.phrase value)
(#.Some phrase)
- (format text.new-line "Attribution Phrase: " phrase text.new-line)
+ (format text.new_line "Attribution Phrase: " phrase text.new_line)
#.None
"")
- url (format text.new-line "Attribution URL: " (get@ #license.url value))
+ url (format text.new_line "Attribution URL: " (get@ #license.url value))
image (case (get@ #license.image value)
(#.Some image)
- (format text.new-line "Attribution Image: " image)
+ (format text.new_line "Attribution Image: " image)
#.None
"")]
- (format copyright-notice
+ (format copyright_notice
phrase
url
image)))
@@ -219,19 +219,19 @@
["Entire Agreement"
on
- miscellaneous.entire-agreement]
+ miscellaneous.entire_agreement]
["Relationship of Parties"
on
- miscellaneous.relationship-of-parties]
+ miscellaneous.relationship_of_parties]
["Independent Development"
on
- miscellaneous.independent-development]
+ miscellaneous.independent_development]
["Consent To Breach Not Waiver"
on
- miscellaneous.not-waiver]
+ miscellaneous.not_waiver]
["Severability"
on
@@ -239,14 +239,14 @@
["Export Restrictions"
on
- miscellaneous.export-restrictions]
+ miscellaneous.export_restrictions]
[(format "Versions of " _.license)
identified?
- miscellaneous.new-versions]
+ miscellaneous.new_versions]
)))))
-(def: black-list-spacing (format text.new-line text.new-line))
+(def: black_list_spacing (format text.new_line text.new_line))
(def: #export (license value)
(-> License Text)
@@ -261,22 +261,22 @@
#.None
false)]
(`` (format ($.block identification)
- ($.block (notice.copyright (get@ #license.copyright-holders value)))
+ ($.block (notice.copyright (get@ #license.copyright_holders value)))
- (case (get@ #license.black-lists value)
+ (case (get@ #license.black_lists value)
#.Nil
""
- black-lists
+ black_lists
($.block ($.section {#$.title (format "Denial of " _.license)
- #$.content (|> black-lists
- (list\map black-list.black-list)
- (text.join-with ..black-list-spacing))})))
+ #$.content (|> black_lists
+ (list\map black_list.black_list)
+ (text.join_with ..black_list_spacing))})))
($.section {#$.title "Definitions"
#$.content (|> definition.all
(list\map (|>> ..definition $.block))
- (text.join-with ""))})
+ (text.join_with ""))})
($.block ($.section {#$.title (format "Acceptance of " _.license)
#$.content limitation.acceptance}))
@@ -305,5 +305,5 @@
(addendum.output (get@ #license.addendum value))
- notice.end-of-license
+ notice.end_of_license
))))
diff --git a/stdlib/source/test/licentia.lux b/licentia/source/test/licentia.lux
index af03062cb..bf0f4929e 100644
--- a/stdlib/source/test/licentia.lux
+++ b/licentia/source/test/licentia.lux
@@ -1,22 +1,21 @@
(.module:
[lux #*
+ [program (#+ program:)]
["_" test (#+ Test)]
[abstract
[monad (#+ do)]]
[control
- [io (#+ io)]
- [parser
- [cli (#+ program:)]]]
+ [io (#+ io)]]
[data
["." bit ("#\." equivalence)]
["." maybe ("#\." functor)]
["." text]
- [number
- ["n" nat ("#\." interval)]]
[collection
["." list ("#\." functor)]]]
[math
- ["." random (#+ Random)]]]
+ ["." random (#+ Random)]
+ [number
+ ["n" nat ("#\." interval)]]]]
{#program
[/
["." license (#+ Identification
@@ -25,7 +24,7 @@
Distribution
Commercial
Extension
- Entity Black-List
+ Entity Black_List
URL Attribution
Addendum
License)
@@ -41,7 +40,7 @@
["." commercial]
["." extension]
["." miscellaneous]
- ["." black-list]
+ ["." black_list]
["." addendum]]
["." output]]})
@@ -50,14 +49,14 @@
(do {! random.monad}
[start (random.filter (|>> (n.= n\top) not)
random.nat)
- #let [wiggle-room (n.- start n\top)]
+ #let [wiggle_room (n.- start n\top)]
end (\ ! map
- (|>> (n.% wiggle-room) (n.max 1))
+ (|>> (n.% wiggle_room) (n.max 1))
random.nat)]
(wrap {#time.start start
#time.end end})))
-(def: copyright-holder
+(def: copyright_holder
(Random copyright.Holder)
($_ random.and
(random.ascii 10)
@@ -107,18 +106,18 @@
(Random Entity)
(random.ascii 10))
-(def: (variable-list max-size gen-element)
+(def: (variable_list max_size gen_element)
(All [a] (-> Nat (Random a) (Random (List a))))
(do {! random.monad}
- [amount (\ ! map (n.% (n.max 1 max-size))
+ [amount (\ ! map (n.% (n.max 1 max_size))
random.nat)]
- (random.list amount gen-element)))
+ (random.list amount gen_element)))
-(def: black-list
- (Random Black-List)
+(def: black_list
+ (Random Black_List)
($_ random.and
(random.maybe (random.ascii 10))
- (variable-list 10 ..entity)))
+ (variable_list 10 ..entity)))
(def: url
(Random URL)
@@ -141,14 +140,14 @@
(def: license
(Random License)
($_ random.and
- (random.list 2 ..copyright-holder)
+ (random.list 2 ..copyright_holder)
(random.maybe ..identification)
..termination
..liability
..distribution
..commercial
..extension
- (variable-list 3 ..black-list)
+ (variable_list 3 ..black_list)
(random.maybe attribution)
..addendum
))
@@ -156,27 +155,27 @@
(type: (Concern a)
(-> (-> Text Bit) a Test))
-(def: (about-grant present? termination)
+(def: (about_grant present? termination)
(Concern Termination)
($_ _.and
(_.test "Copyright grant is present."
(present? grant.copyright))
(_.test "Patent grant is present."
- (present? (grant.patent (get@ #license.patent-retaliation? termination))))
+ (present? (grant.patent (get@ #license.patent_retaliation? termination))))
(_.test "Effective date for the grants is present."
(present? grant.date))
(_.test "Patent grant is present."
- (present? (grant.termination (get@ #license.termination-period termination)
- (get@ #license.grace-period termination))))
+ (present? (grant.termination (get@ #license.termination_period termination)
+ (get@ #license.grace_period termination))))
(_.test "The termination period is accurately conveyed."
- (present? (grant.grant-restoration-clause (get@ #license.termination-period termination))))
+ (present? (grant.grant_restoration_clause (get@ #license.termination_period termination))))
(_.test "The grace period is accurately conveyed."
- (present? (grant.grace-period-clause (get@ #license.grace-period termination))))
+ (present? (grant.grace_period_clause (get@ #license.grace_period termination))))
(_.test "The grants are not retro-actively terminated."
- (present? grant.no-retroactive-termination))
+ (present? grant.no_retroactive_termination))
))
-(def: (about-liability present? liability)
+(def: (about_liability present? liability)
(Concern Liability)
($_ _.and
(_.test "Warranty liability disclaimer is present."
@@ -186,65 +185,65 @@
(_.test "Litigation conditions are present."
(present? liability.litigation))
(_.test "Liability acceptance conditions may be present."
- (bit\= (get@ #license.can-accept? liability)
- (present? liability.can-accept)))
+ (bit\= (get@ #license.can_accept? liability)
+ (present? liability.can_accept)))
(_.test "Liability acceptance conditions may be present."
- (bit\= (get@ #license.disclaim-high-risk? liability)
- (present? liability.disclaim-high-risk)))
+ (bit\= (get@ #license.disclaim_high_risk? liability)
+ (present? liability.disclaim_high_risk)))
))
-(def: (about-distribution present? distribution)
+(def: (about_distribution present? distribution)
(Concern Distribution)
($_ _.and
(_.test "Conditions for source-code distribution are present."
- (present? distribution.source-code-form))
+ (present? distribution.source_code_form))
(_.test "Conditions for object-code distribution are present."
- (present? distribution.object-form))
+ (present? distribution.object_form))
(_.test "Conditions for extension distribution are present."
(present? (distribution.extension distribution)))
))
-(def: (about-commercial present? commercial)
+(def: (about_commercial present? commercial)
(Concern Commercial)
($_ _.and
(_.test "Non-commercial clause is present."
- (bit\= (not (get@ #license.can-sell? commercial))
- (present? commercial.cannot-sell)))
+ (bit\= (not (get@ #license.can_sell? commercial))
+ (present? commercial.cannot_sell)))
(_.test "Contributor credit condition is present."
- (bit\= (get@ #license.require-contributor-credit? commercial)
- (present? commercial.require-contributor-attribution)))
+ (bit\= (get@ #license.require_contributor_credit? commercial)
+ (present? commercial.require_contributor_attribution)))
(_.test "Anti-endorsement condition is present."
- (bit\= (not (get@ #license.allow-contributor-endorsement? commercial))
- (present? commercial.disallow-contributor-endorsement)))
+ (bit\= (not (get@ #license.allow_contributor_endorsement? commercial))
+ (present? commercial.disallow_contributor_endorsement)))
))
-(def: (about-extension present? extension)
+(def: (about_extension present? extension)
(Concern Extension)
($_ _.and
(_.test "The license is viral."
- (bit\= (get@ #license.same-license? extension)
- (and (list.every? present? extension.sharing-requirement)
- (list.every? present? extension.license-conflict-resolution))))
+ (bit\= (get@ #license.same_license? extension)
+ (and (list.every? present? extension.sharing_requirement)
+ (list.every? present? extension.license_conflict_resolution))))
(_.test "Extensions must be distinguishable from the original work."
- (bit\= (get@ #license.must-be-distinguishable? extension)
- (present? extension.distinctness-requirement)))
+ (bit\= (get@ #license.must_be_distinguishable? extension)
+ (present? extension.distinctness_requirement)))
(_.test "The community must be notified of new extensions."
- (case (get@ #license.notification-period extension)
+ (case (get@ #license.notification_period extension)
(#.Some period)
- (present? (extension.notification-requirement period))
+ (present? (extension.notification_requirement period))
#.None
true))
(_.test "Must describe modifications."
- (bit\= (get@ #license.must-describe-modifications? extension)
- (present? extension.description-requirement)))
+ (bit\= (get@ #license.must_describe_modifications? extension)
+ (present? extension.description_requirement)))
))
-(def: (about-attribution present? attribution)
+(def: (about_attribution present? attribution)
(Concern Attribution)
($_ _.and
(_.test "The attribution copyright notice is present."
- (present? (get@ #license.copyright-notice attribution)))
+ (present? (get@ #license.copyright_notice attribution)))
(_.test "The attribution phrase is present."
(|> attribution
(get@ #license.phrase)
@@ -259,29 +258,29 @@
(maybe.default true)))
))
-(def: (about-miscellaneous present?)
+(def: (about_miscellaneous present?)
(-> (-> Text Bit) Test)
($_ _.and
(_.test "License constitutes the entire agreement."
- (present? miscellaneous.entire-agreement))
+ (present? miscellaneous.entire_agreement))
(_.test "Disclaims relationship of parties."
- (present? miscellaneous.relationship-of-parties))
+ (present? miscellaneous.relationship_of_parties))
(_.test "Explicitly allows independent development."
- (present? miscellaneous.independent-development))
+ (present? miscellaneous.independent_development))
(_.test "Clarifies consent to breach does not waiver."
- (present? miscellaneous.not-waiver))
+ (present? miscellaneous.not_waiver))
(_.test "Provides severability."
(present? miscellaneous.severability))
(_.test "Covers export restrictions."
- (present? miscellaneous.export-restrictions))
+ (present? miscellaneous.export_restrictions))
))
-(def: (about-addendum present? value)
+(def: (about_addendum present? value)
(Concern Addendum)
($_ _.and
(_.test "Commons clause"
- (bit\= (get@ #license.commons-clause? value)
- (present? addendum.commons-clause)))
+ (bit\= (get@ #license.commons_clause? value)
+ (present? addendum.commons_clause)))
))
(def: test
@@ -294,33 +293,33 @@
(text.contains? snippet writ)))]]
($_ _.and
(_.test "Copyright notices are present."
- (list.every? (|>> notice.copyright-holder present?)
- (get@ #license.copyright-holders license)))
+ (list.every? (|>> notice.copyright_holder present?)
+ (get@ #license.copyright_holders license)))
(_.test "Identification is present (if the license is identified)."
(case (get@ #license.identification license)
(#.Some identification)
(and (present? (output.identification identification))
- (present? miscellaneous.new-versions))
+ (present? miscellaneous.new_versions))
#.None
- (not (present? miscellaneous.new-versions))))
+ (not (present? miscellaneous.new_versions))))
(_.test "Black-lists (if wanted by licensor) are explicitly enumerated and justified."
- (list.every? (function (_ black-list)
- (let [black-list-is-justified? (case (get@ #license.justification black-list)
+ (list.every? (function (_ black_list)
+ (let [black_list_is_justified? (case (get@ #license.justification black_list)
(#.Some justification)
(present? justification)
#.None
yes)
- every-entity-is-mentioned? (|> black-list
+ every_entity_is_mentioned? (|> black_list
(get@ #license.entities)
- (list\map black-list.entity)
+ (list\map black_list.entity)
(list.every? present?))]
- (and black-list-is-justified?
- every-entity-is-mentioned?)))
- (get@ #license.black-lists license)))
+ (and black_list_is_justified?
+ every_entity_is_mentioned?)))
+ (get@ #license.black_lists license)))
(_.test "All definitions are present."
(list.every? (|>> output.definition present?)
@@ -329,7 +328,7 @@
(_.test "Acceptance of the license is demanded."
(present? limitation.acceptance))
- (..about-grant present? (get@ #license.termination license))
+ (..about_grant present? (get@ #license.termination license))
(_.test "All limitations are present."
(present? output.limitation))
@@ -340,28 +339,28 @@
(_.test "The terms of submission are present."
(present? submission.contribution))
- (..about-liability present? (get@ #license.liability license))
+ (..about_liability present? (get@ #license.liability license))
- (..about-distribution present? (get@ #license.distribution license))
+ (..about_distribution present? (get@ #license.distribution license))
- (..about-commercial present? (get@ #license.commercial license))
+ (..about_commercial present? (get@ #license.commercial license))
- (..about-extension present? (get@ #license.extension license))
+ (..about_extension present? (get@ #license.extension license))
(case (get@ #license.attribution license)
(#.Some attribution)
- (..about-attribution present? attribution)
+ (..about_attribution present? attribution)
#.None
(_.test "Attribution is missing."
yes))
- (..about-miscellaneous present?)
+ (..about_miscellaneous present?)
- (..about-addendum present? (get@ #license.addendum license))
+ (..about_addendum present? (get@ #license.addendum license))
(_.test "License ending footer is present."
- (present? notice.end-of-license))
+ (present? notice.end_of_license))
)))
(program: args
diff --git a/stdlib/project.clj b/stdlib/project.clj
index 7905f82b3..81a7dc180 100644
--- a/stdlib/project.clj
+++ b/stdlib/project.clj
@@ -30,9 +30,5 @@
:test "test/aedifex"}}
:scriptum {:description "A documentation generator for Lux code."
:dependencies []
- :lux {:program "program/scriptum"}}
- :licentia {:description "A program for producing free/open-source/reciprocal licenses."
- :dependencies []
- :lux {:program "program/licentia"
- :test "test/licentia"}}}
+ :lux {:program "program/scriptum"}}}
)
diff --git a/stdlib/source/lux/control/function.lux b/stdlib/source/lux/control/function.lux
index d9b8e36c5..855f585c9 100644
--- a/stdlib/source/lux/control/function.lux
+++ b/stdlib/source/lux/control/function.lux
@@ -6,9 +6,8 @@
(def: #export identity
{#.doc (doc "Identity function."
"Does nothing to its argument and just returns it."
- (let [value "foo"]
- (is? (identity value)
- value)))}
+ (is? (identity value)
+ value))}
(All [a] (-> a a))
(|>>))
diff --git a/stdlib/source/lux/control/function/mutual.lux b/stdlib/source/lux/control/function/mutual.lux
new file mode 100644
index 000000000..705545896
--- /dev/null
+++ b/stdlib/source/lux/control/function/mutual.lux
@@ -0,0 +1,242 @@
+(.module:
+ [lux (#- Definition let def:)
+ ["." meta]
+ [abstract
+ ["." monad (#+ do)]]
+ [control
+ ["." try (#+ Try)]
+ ["." exception (#+ exception:)]
+ ["<>" parser ("#\." monad)
+ ["<.>" code (#+ Parser)]]]
+ [data
+ ["." product]
+ [text
+ ["%" format (#+ format)]]
+ [collection
+ ["." list ("#\." functor)]
+ [dictionary
+ ["." plist (#+ PList)]]]]
+ ["." macro
+ ["." code]
+ [syntax (#+ syntax:)
+ ["." export]
+ ["." declaration (#+ Declaration)]]]]
+ ["." //])
+
+(type: Mutual
+ {#declaration Declaration
+ #type Code
+ #body Code})
+
+(.def: mutual
+ (Parser [Declaration Code Code])
+ ($_ <>.and
+ declaration.parser
+ <code>.any
+ <code>.any
+ ))
+
+(.def: (mutual_definition context g!context [g!name mutual])
+ (-> (List Code) Code [Code Mutual] Code)
+ (` (function ((~ g!name) (~ g!context))
+ (.let [[(~+ context)] (~ g!context)]
+ (function (~ (declaration.format (get@ #declaration mutual)))
+ (~ (get@ #body mutual)))))))
+
+(exception: #export (unknown_module {module Text})
+ (exception.report
+ ["Module" (%.text module)]))
+
+(template [<name>]
+ [(exception: #export (<name> {module Text} {definition Text})
+ (exception.report
+ ["Module" (%.text module)]
+ ["Definition" (%.text definition)]))]
+
+ [cannot_shadow_definition]
+ [unknown_definition]
+ )
+
+(.def: (with_module name body)
+ (All [a] (-> Text (-> Module (Try [Module a])) (Meta a)))
+ (function (_ compiler)
+ (case (|> compiler (get@ #.modules) (plist.get name))
+ (#.Some module)
+ (case (body module)
+ (#try.Success [module' output])
+ (#try.Success [(update@ #.modules (plist.put name module') compiler)
+ output])
+
+ (#try.Failure error)
+ (#try.Failure error))
+
+ #.None
+ (exception.throw ..unknown_module [name]))))
+
+(.def: (push_one [name macro])
+ (-> [Name Macro] (Meta Any))
+ (do meta.monad
+ [[module_name definition_name] (meta.normalize name)
+ #let [definition (: Global (#.Definition [false .Macro (' {}) macro]))
+ add_macro! (: (-> (PList Global) (PList Global))
+ (plist.put definition_name definition))]]
+ (..with_module module_name
+ (function (_ module)
+ (case (|> module (get@ #.definitions) (plist.get definition_name))
+ #.None
+ (#try.Success [(update@ #.definitions add_macro! module)
+ []])
+
+ (#.Some _)
+ (exception.throw ..cannot_shadow_definition [module_name definition_name]))))))
+
+(.def: (pop_one name)
+ (-> Name (Meta Any))
+ (do meta.monad
+ [[module_name definition_name] (meta.normalize name)
+ #let [remove_macro! (: (-> (PList Global) (PList Global))
+ (plist.remove definition_name))]]
+ (..with_module module_name
+ (function (_ module)
+ (case (|> module (get@ #.definitions) (plist.get definition_name))
+ (#.Some _)
+ (#try.Success [(update@ #.definitions remove_macro! module)
+ []])
+
+ #.None
+ (exception.throw ..unknown_definition [module_name definition_name]))))))
+
+(.def: (pop_all macros self)
+ (-> (List Name) Name Macro)
+ (<| (:coerce Macro)
+ (: Macro')
+ (function (_ _)
+ (do {! meta.monad}
+ [_ (monad.map ! ..pop_one macros)
+ _ (..pop_one self)
+ compiler meta.get_compiler]
+ (wrap (case (get@ #.expected compiler)
+ (#.Some _) (list (' []))
+ #.None (list)))))))
+
+(.def: (push_all macros)
+ (-> (List [Name Macro]) (Meta Code))
+ (do meta.monad
+ [_ (monad.map meta.monad ..push_one macros)
+ seed meta.count
+ g!pop (macro.gensym "pop")
+ _ (.let [g!pop (: Name ["" (%.code g!pop)])]
+ (..push_one [g!pop (..pop_all (list\map product.left macros) g!pop)]))]
+ (wrap (` ((~ g!pop))))))
+
+(.def: (macro g!context g!self)
+ (-> Code Code Macro)
+ (<| (:coerce Macro)
+ (: Macro')
+ (function (_ parameters)
+ (\ meta.monad wrap (list (` (((~ g!self) (~ g!context)) (~+ parameters))))))))
+
+(syntax: #export (let {functions (<code>.tuple (<>.some ..mutual))}
+ body)
+ (case functions
+ #.Nil
+ (wrap (list body))
+
+ (#.Cons mutual #.Nil)
+ (.let [g!name (|> mutual (get@ [#declaration #declaration.name]) code.local_identifier)]
+ (wrap (list (` (.let [(~ g!name) (: (~ (get@ #type mutual))
+ (function (~ (declaration.format (get@ #declaration mutual)))
+ (~ (get@ #body mutual))))]
+ (~ body))))))
+
+ _
+ (macro.with_gensyms [g!context g!output]
+ (do {! meta.monad}
+ [here_name meta.current_module_name
+ hidden_names (monad.map ! (//.constant (macro.gensym "mutual_function#"))
+ functions)
+ #let [definitions (list\map (..mutual_definition hidden_names g!context)
+ (list.zip/2 hidden_names
+ functions))
+ context_types (list\map (function (_ mutual)
+ (` (-> (~ g!context) (~ (get@ #type mutual)))))
+ functions)
+ user_names (list\map (|>> (get@ [#declaration #declaration.name]) code.local_identifier)
+ functions)]
+ g!pop (..push_all (list\map (function (_ [g!name mutual])
+ [[here_name (get@ [#declaration #declaration.name] mutual)]
+ (..macro g!context g!name)])
+ (list.zip/2 hidden_names
+ functions)))]
+ (wrap (list (` (.let [(~ g!context) (: (Rec (~ g!context)
+ [(~+ context_types)])
+ [(~+ definitions)])
+ [(~+ user_names)] (.let [[(~+ user_names)] (~ g!context)]
+ [(~+ (list\map (function (_ g!name)
+ (` ((~ g!name) (~ g!context))))
+ user_names))])
+ (~ g!output) (~ body)]
+ (exec (~ g!pop)
+ (~ g!output))))))))))
+
+(type: Definition
+ {#exported? Bit
+ #mutual Mutual})
+
+(.def: definition
+ (Parser Definition)
+ (<code>.tuple (<>.and export.parser
+ ..mutual)))
+
+(syntax: #export (def: {functions (<>.many ..definition)})
+ (case functions
+ #.Nil
+ (wrap (list))
+
+ (#.Cons definition #.Nil)
+ (.let [(^slots [#exported? #mutual]) definition
+ (^slots [#declaration #type #body]) mutual]
+ (wrap (list (` (.def:
+ (~+ (export.format exported?))
+ (~ (declaration.format declaration))
+ (~ type)
+ (~ body))))))
+
+ _
+ (macro.with_gensyms [g!context g!output]
+ (do {! meta.monad}
+ [here_name meta.current_module_name
+ hidden_names (monad.map ! (//.constant (macro.gensym "mutual_function#"))
+ functions)
+ #let [definitions (list\map (..mutual_definition hidden_names g!context)
+ (list.zip/2 hidden_names
+ (list\map (get@ #mutual) functions)))
+ context_types (list\map (function (_ mutual)
+ (` (-> (~ g!context) (~ (get@ [#mutual #type] mutual)))))
+ functions)
+ user_names (list\map (|>> (get@ [#mutual #declaration #declaration.name]) code.local_identifier)
+ functions)]
+ g!pop (..push_all (list\map (function (_ [g!name mutual])
+ [[here_name (get@ [#mutual #declaration #declaration.name] mutual)]
+ (..macro g!context g!name)])
+ (list.zip/2 hidden_names
+ functions)))]
+ (wrap (list& (` (.def: (~ g!context)
+ [(~+ (list\map (get@ [#mutual #type]) functions))]
+ (.let [(~ g!context) (: (Rec (~ g!context)
+ [(~+ context_types)])
+ [(~+ definitions)])
+ [(~+ user_names)] (~ g!context)]
+ [(~+ (list\map (function (_ g!name)
+ (` ((~ g!name) (~ g!context))))
+ user_names))])))
+ g!pop
+ (list\map (function (_ mutual)
+ (.let [g!name (|> mutual (get@ [#mutual #declaration #declaration.name]) code.local_identifier)]
+ (` (.def:
+ (~+ (export.format (get@ #exported? mutual)))
+ (~ g!name)
+ (~ (get@ [#mutual #type] mutual))
+ (.let [[(~+ user_names)] (~ g!context)]
+ (~ g!name))))))
+ functions)))))))
diff --git a/stdlib/source/lux/macro/template.lux b/stdlib/source/lux/macro/template.lux
index a76b1d989..d51af1d5c 100644
--- a/stdlib/source/lux/macro/template.lux
+++ b/stdlib/source/lux/macro/template.lux
@@ -170,7 +170,7 @@
#.None
(#try.Success (update@ #.definitions
(plist.put definition
- (#.Definition [false .Macro (' []) (..macro local)]))
+ (#.Definition [false .Macro (' {}) (..macro local)]))
module))
(#.Some _)
diff --git a/stdlib/source/lux/meta.lux b/stdlib/source/lux/meta.lux
index 454d33498..d7788bd13 100644
--- a/stdlib/source/lux/meta.lux
+++ b/stdlib/source/lux/meta.lux
@@ -158,7 +158,7 @@
(case name
["" name]
(do ..monad
- [module_name current_module_name]
+ [module_name ..current_module_name]
(wrap [module_name name]))
_
diff --git a/stdlib/source/lux/target.lux b/stdlib/source/lux/target.lux
index a5188a907..572c95c90 100644
--- a/stdlib/source/lux/target.lux
+++ b/stdlib/source/lux/target.lux
@@ -1,11 +1,13 @@
(.module:
lux)
-(type: #export Host
+(type: #export Target
Text)
(template [<name> <value>]
- [(def: #export <name> Host <value>)]
+ [(def: #export <name>
+ Target
+ <value>)]
## TODO: Delete ASAP
[old "{old}"]
diff --git a/stdlib/source/lux/world/output/video/resolution.lux b/stdlib/source/lux/world/output/video/resolution.lux
index 01a7e4c3a..2dbe1c8bc 100644
--- a/stdlib/source/lux/world/output/video/resolution.lux
+++ b/stdlib/source/lux/world/output/video/resolution.lux
@@ -1,10 +1,26 @@
(.module:
- [lux #*])
+ [lux #*
+ [abstract
+ [equivalence (#+ Equivalence)]
+ [hash (#+ Hash)]]
+ [data
+ ["." product]]
+ [math
+ [number
+ ["." nat]]]])
(type: #export Resolution
{#width Nat
#height Nat})
+(def: #export hash
+ (Hash Resolution)
+ (product.hash nat.hash nat.hash))
+
+(def: #export equivalence
+ (Equivalence Resolution)
+ (\ ..hash &equivalence))
+
## https://en.wikipedia.org/wiki/Display_resolution#Common_display_resolutions
(template [<name> <width> <height>]
[(def: #export <name>
@@ -16,9 +32,9 @@
[wsvga 1024 600]
[xga 1024 768]
[xga+ 1152 864]
- [wxga|16:9 1280 720]
- [wxga|5:3 1280 768]
- [wxga|16:10 1280 800]
+ [wxga/16:9 1280 720]
+ [wxga/5:3 1280 768]
+ [wxga/16:10 1280 800]
[sxga 1280 1024]
[wxga+ 1440 900]
[hd+ 1600 900]
diff --git a/stdlib/source/program/aedifex/artifact/time.lux b/stdlib/source/program/aedifex/artifact/time.lux
index 59367c37d..b227c3954 100644
--- a/stdlib/source/program/aedifex/artifact/time.lux
+++ b/stdlib/source/program/aedifex/artifact/time.lux
@@ -5,12 +5,15 @@
[equivalence (#+ Equivalence)]
[monad (#+ do)]]
[control
+ ["." try (#+ Try)]
["<>" parser
["<.>" text (#+ Parser)]]]
[data
["." product]
[text
- ["%" format (#+ Format)]]]]
+ ["%" format (#+ Format)]]]
+ [time
+ ["." instant (#+ Instant)]]]
["." / #_
["#." date]
["#." time]])
@@ -22,6 +25,13 @@
Time
[/date.epoch time.midnight])
+(def: #export (from_instant instant)
+ (-> Instant (Try Time))
+ (do try.monad
+ [date (/date.date (instant.date instant))]
+ (wrap [date
+ (instant.time instant)])))
+
(def: #export equivalence
(Equivalence Time)
(product.equivalence /date.equivalence
diff --git a/stdlib/source/program/aedifex/metadata/snapshot.lux b/stdlib/source/program/aedifex/metadata/snapshot.lux
index f6878a023..c8feaa3d9 100644
--- a/stdlib/source/program/aedifex/metadata/snapshot.lux
+++ b/stdlib/source/program/aedifex/metadata/snapshot.lux
@@ -37,6 +37,7 @@
["/#" // #_
[repository (#+ Repository)]
["#." artifact (#+ Group Name Version Artifact)
+ ["#/." time]
["#/." type (#+ Type)]
["#/." versioning (#+ Versioning)]
["#/." snapshot
@@ -99,7 +100,7 @@
(|>> (case> (^ (list))
(list {#///artifact/snapshot/version.extension ///artifact/type.jvm_library
#///artifact/snapshot/version.value version
- #///artifact/snapshot/version.updated instant.epoch})
+ #///artifact/snapshot/version.updated ///artifact/time.epoch})
versions
versions))))
diff --git a/stdlib/source/program/aedifex/repository/local.lux b/stdlib/source/program/aedifex/repository/local.lux
index 6b4575627..d026559c9 100644
--- a/stdlib/source/program/aedifex/repository/local.lux
+++ b/stdlib/source/program/aedifex/repository/local.lux
@@ -36,13 +36,11 @@
Bit
URI
(Promise (Try (File Promise))))
- (do {! promise.monad}
- [#let [uri (text.replace_once ///metadata.remote_file ///metadata.local_file uri)]
- home (\ program home [])
- #let [/ (\ system separator)
- absolute_path (format home / (..root /) / (..path / uri))]]
+ (let [uri (text.replace_once ///metadata.remote_file ///metadata.local_file uri)
+ / (\ system separator)
+ absolute_path (format (..root /) / (..path / uri))]
(if create?
- (do {! (try.with !)}
+ (do {! (try.with promise.monad)}
[_ (: (Promise (Try Path))
(file.make_directories promise.monad system (file.parent system absolute_path)))]
(: (Promise (Try (File Promise)))
diff --git a/stdlib/source/test/aedifex.lux b/stdlib/source/test/aedifex.lux
index 3833c0828..ae9bde67c 100644
--- a/stdlib/source/test/aedifex.lux
+++ b/stdlib/source/test/aedifex.lux
@@ -1,66 +1,49 @@
(.module:
[lux #*
+ [program (#+ program:)]
["_" test (#+ Test)]
[control
- [io (#+ io)]
- [parser
- [cli (#+ program:)]]]]
+ [io (#+ io)]]]
["." / #_
["#." artifact]
- ["#." input]
- ["#." command #_
- ["#/." version]
- ["#/." clean]
- ["#/." pom]
- ["#/." install]
- ["#/." deploy]
- ["#/." deps]
- ["#/." build]
- ["#/." test]
- ["#/." auto]]
- ["#." local]
- ["#." dependency
- ["#/." resolution]
- ["#/." status]]
- ["#." package]
- ["#." profile]
- ["#." project]
["#." cli]
- ["#." hash]
- ["#." parser]
- ["#." pom]
- ["#." repository]
- ["#." runtime]
- ["#." metadata]])
+ ["#." command]
+ ## ["#." input]
+ ## ["#." local]
+ ## ["#." dependency
+ ## ## ["#/." resolution]
+ ## ["#/." status]]
+ ## ["#." package]
+ ## ["#." profile]
+ ## ["#." project]
+ ## ["#." hash]
+ ## ["#." parser]
+ ## ["#." pom]
+ ## ["#." repository]
+ ## ["#." runtime]
+ ## ["#." metadata]
+ ])
(def: test
Test
($_ _.and
/artifact.test
- /input.test
- /command/version.test
- /command/clean.test
- /command/pom.test
- /command/install.test
- /command/deploy.test
- /command/deps.test
- /command/build.test
- /command/test.test
- /command/auto.test
- /local.test
- /dependency.test
- /dependency/resolution.test
- /dependency/status.test
- /package.test
- /profile.test
- /project.test
/cli.test
- /hash.test
- /parser.test
- /pom.test
- /repository.test
- /runtime.test
- /metadata.test
+ /command.test
+ ## /input.test
+ ## /local.test
+ ## /dependency.test
+ ## ## /dependency/resolution.test
+ ## /dependency/status.test
+ ## /package.test
+ ## /profile.test
+ ## /project.test
+ ## /hash.test
+ ## /parser.test
+ ## /pom.test
+ ## /repository.test
+ ## /runtime.test
+ ## /metadata.test
))
(program: args
diff --git a/stdlib/source/test/aedifex/command.lux b/stdlib/source/test/aedifex/command.lux
new file mode 100644
index 000000000..0ef18f044
--- /dev/null
+++ b/stdlib/source/test/aedifex/command.lux
@@ -0,0 +1,32 @@
+(.module:
+ [lux #*
+ ["_" test (#+ Test)]]
+ ["." / #_
+ ["#." clean]
+ ["#." install]
+ ["#." pom]
+ ["#." version]]
+ {#program
+ ["." /
+ ## ["#." deploy]
+ ## ["#." deps]
+ ## ["#." build]
+ ## ["#." test]
+ ## ["#." auto]
+ ]})
+
+(def: #export test
+ Test
+ (<| (_.covering /._)
+ (_.for [/.Command])
+ ($_ _.and
+ /clean.test
+ /install.test
+ /pom.test
+ /version.test
+ ## /deploy.test
+ ## /deps.test
+ ## /build.test
+ ## /test.test
+ ## /auto.test
+ )))
diff --git a/stdlib/source/test/aedifex/command/install.lux b/stdlib/source/test/aedifex/command/install.lux
index ce3f21de8..33ee7192d 100644
--- a/stdlib/source/test/aedifex/command/install.lux
+++ b/stdlib/source/test/aedifex/command/install.lux
@@ -16,8 +16,7 @@
["." maybe]
["." binary]
["." text ("#\." equivalence)
- ["%" format (#+ format)]
- ["." encoding]]
+ ["%" format (#+ format)]]
[format
["." xml]]
[collection
@@ -67,13 +66,11 @@
(def: (execute! program fs sample)
(-> (Program Promise) (file.System Promise) ///.Profile (Promise (Try Text)))
- (do promise.monad
- [home (\ program home [])]
- (do ///action.monad
- [#let [console (@version.echo "")]
- _ (..make_sources! fs (get@ #///.sources sample))
- _ (/.do! console fs (///repository/local.repository program fs) sample)]
- (!.use (\ console read_line) []))))
+ (do ///action.monad
+ [#let [console (@version.echo "")]
+ _ (..make_sources! fs (get@ #///.sources sample))
+ _ (/.do! console fs (///repository/local.repository program fs) sample)]
+ (!.use (\ console read_line) [])))
(def: #export test
Test
@@ -91,17 +88,18 @@
verdict (do ///action.monad
[logging (..execute! program fs sample)
#let [/ uri.separator
- artifact_path (format (///local.uri identity) / (///artifact.identity identity))
+ artifact_path (///local.uri (get@ #///artifact.version identity) identity)
library_path (format artifact_path ///artifact/extension.lux_library)
pom_path (format artifact_path ///artifact/extension.pom)]
+ #let [succeeded! (text\= //clean.success logging)]
library_exists! (\ promise.monad map
exception.return
(file.file_exists? promise.monad fs library_path))
pom_exists! (\ promise.monad map
exception.return
(file.file_exists? promise.monad fs pom_path))]
- (wrap (and (text\= //clean.success logging)
+ (wrap (and succeeded!
library_exists!
pom_exists!)))]
(_.cover' [/.do!]
diff --git a/stdlib/source/test/aedifex/command/pom.lux b/stdlib/source/test/aedifex/command/pom.lux
index 33c102926..c368d5f84 100644
--- a/stdlib/source/test/aedifex/command/pom.lux
+++ b/stdlib/source/test/aedifex/command/pom.lux
@@ -12,7 +12,8 @@
[data
["." binary]
["." text ("#\." equivalence)
- ["." encoding]]
+ [encoding
+ ["." utf8]]]
[format
["." xml]]]
[math
@@ -46,7 +47,7 @@
(do !
[verdict (do ///action.monad
[expected (|> (///pom.write sample)
- (try\map (|>> (\ xml.codec encode) (\ encoding.utf8 encode)))
+ (try\map (|>> (\ xml.codec encode) (\ utf8.codec encode)))
(\ ! wrap))
file (: (Promise (Try (File Promise)))
(file.get_file promise.monad fs path))
diff --git a/stdlib/source/test/aedifex/command/version.lux b/stdlib/source/test/aedifex/command/version.lux
index ee26b3b5d..c7a9aa4ef 100644
--- a/stdlib/source/test/aedifex/command/version.lux
+++ b/stdlib/source/test/aedifex/command/version.lux
@@ -60,7 +60,9 @@
(def: #export echo
(-> Text (Console Promise))
- (|>> [true] (console.mock ..simulation)))
+ (|>> [true]
+ (console.mock ..simulation)
+ console.async))
(def: #export test
Test
diff --git a/stdlib/source/test/lux/control/function.lux b/stdlib/source/test/lux/control/function.lux
index f816075f5..354433cc8 100644
--- a/stdlib/source/test/lux/control/function.lux
+++ b/stdlib/source/test/lux/control/function.lux
@@ -18,7 +18,8 @@
["." / #_
["#." contract]
["#." memo]
- ["#." mixin]])
+ ["#." mixin]
+ ["#." mutual]])
(def: #export test
Test
@@ -62,4 +63,5 @@
/contract.test
/memo.test
/mixin.test
+ /mutual.test
))))
diff --git a/stdlib/source/test/lux/control/function/mutual.lux b/stdlib/source/test/lux/control/function/mutual.lux
new file mode 100644
index 000000000..e645e282b
--- /dev/null
+++ b/stdlib/source/test/lux/control/function/mutual.lux
@@ -0,0 +1,65 @@
+(.module:
+ [lux #*
+ ["_" test (#+ Test)]
+ [abstract
+ [monad (#+ do)]]
+ [data
+ ["." bit ("#\." equivalence)]
+ [text
+ ["%" format (#+ format)]]]
+ [math
+ ["." random (#+ Random)]
+ [number
+ ["n" nat]]]]
+ {1
+ ["." /]})
+
+(def: test_let
+ Test
+ (do {! random.monad}
+ [sample (\ ! map (n.% 10) random.nat)
+ #let [expected (n.even? sample)]]
+ (<| (_.cover [/.let])
+ (/.let [(even? number)
+ (-> Nat Bit)
+ (case number
+ 0 true
+ _ (odd? (dec number)))
+
+ (odd? number)
+ (-> Nat Bit)
+ (case number
+ 0 false
+ _ (even? (dec number)))]
+ (and (bit\= expected (even? sample))
+ (bit\= (not expected) (odd? sample)))))))
+
+(/.def:
+ [(even? number)
+ (-> Nat Bit)
+ (case number
+ 0 true
+ _ (odd? (dec number)))]
+
+ [(odd? number)
+ (-> Nat Bit)
+ (case number
+ 0 false
+ _ (even? (dec number)))])
+
+(def: test_def
+ Test
+ (do {! random.monad}
+ [sample (\ ! map (n.% 10) random.nat)
+ #let [expected (n.even? sample)]]
+ (<| (_.cover [/.def:])
+ (and (bit\= expected (..even? sample))
+ (bit\= (not expected) (..odd? sample))))))
+
+(def: #export test
+ Test
+ (<| (_.covering /._)
+ ($_ _.and
+ ..test_let
+ ..test_def
+ )))
diff --git a/stdlib/source/test/lux/world.lux b/stdlib/source/test/lux/world.lux
index 0405ef7ee..8b560ca40 100644
--- a/stdlib/source/test/lux/world.lux
+++ b/stdlib/source/test/lux/world.lux
@@ -5,7 +5,10 @@
["#." file]
["#." shell]
["#." console]
- ["#." program]])
+ ["#." program]
+ ["#." output #_
+ ["#/." video #_
+ ["#/." resolution]]]])
(def: #export test
Test
@@ -14,4 +17,5 @@
/shell.test
/console.test
/program.test
+ /output/video/resolution.test
))
diff --git a/stdlib/source/test/lux/world/output/video/resolution.lux b/stdlib/source/test/lux/world/output/video/resolution.lux
new file mode 100644
index 000000000..f5dcf5380
--- /dev/null
+++ b/stdlib/source/test/lux/world/output/video/resolution.lux
@@ -0,0 +1,63 @@
+(.module:
+ [lux #*
+ ["_" test (#+ Test)]
+ [abstract
+ [monad (#+ do)]
+ {[0 #spec]
+ [/
+ ["$." equivalence]
+ ["$." hash]]}]
+ [data
+ ["." maybe]
+ [collection
+ ["." list]
+ ["." set (#+ Set)]]]
+ [math
+ ["." random (#+ Random)]
+ [number
+ ["n" nat]]]]
+ {1
+ ["." /]})
+
+(with_expansions [<resolutions> (as_is /.svga
+ /.wsvga
+ /.xga
+ /.xga+
+ /.wxga/16:9
+ /.wxga/5:3
+ /.wxga/16:10
+ /.sxga
+ /.wxga+
+ /.hd+
+ /.wsxga+
+ /.fhd
+ /.wuxga
+ /.wqhd
+ /.uhd-4k)]
+ (def: catalogue
+ (Set /.Resolution)
+ (set.from_list /.hash (list <resolutions>)))
+
+ (def: #export random
+ (Random /.Resolution)
+ (let [listing (set.to_list catalogue)
+ count (list.size listing)]
+ (do {! random.monad}
+ [choice (\ ! map (n.% count) random.nat)]
+ (wrap (maybe.assume (list.nth choice listing))))))
+
+ (def: #export test
+ Test
+ (<| (_.covering /._)
+ (_.for [/.Resolution])
+ ($_ _.and
+ (_.for [/.equivalence]
+ ($equivalence.spec /.equivalence ..random))
+ (_.for [/.hash]
+ ($hash.spec /.hash ..random))
+
+ (_.cover [<resolutions>]
+ (let [listing (set.to_list catalogue)]
+ (n.= (list.size listing)
+ (set.size catalogue))))
+ ))))