From 0d909187d5b9effcd08f533d50af7d29c0d6bfd8 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 8 Apr 2022 05:42:36 -0400 Subject: De-sigil-ification: $ --- licentia/source/program/licentia/input.lux | 98 ++--- .../program/licentia/license/distribution.lux | 14 +- licentia/source/test/licentia.lux | 446 ++++++++++----------- 3 files changed, 279 insertions(+), 279 deletions(-) (limited to 'licentia/source') diff --git a/licentia/source/program/licentia/input.lux b/licentia/source/program/licentia/input.lux index 23e8ab29e..b92d0e52e 100644 --- a/licentia/source/program/licentia/input.lux +++ b/licentia/source/program/licentia/input.lux @@ -32,9 +32,9 @@ (def: identification (Parser Identification) (.object - ($_ <>.and - (.field "name" .string) - (.field "version" .string)))) + (all <>.and + (.field "name" .string) + (.field "version" .string)))) (exception: .public (cannot_use_fractional_amount [amount Frac]) (exception.report @@ -76,48 +76,48 @@ (def: copyright_holder (Parser copyright.Holder) (.object - ($_ <>.and - (.field "name" .string) - (.field "period" ..period)))) + (all <>.and + (.field "name" .string) + (.field "period" ..period)))) (def: termination (Parser Termination) (.object - ($_ <>.and - (.field "patent retaliation?" .boolean) - (.field "termination period" ..amount) - (.field "grace period" ..amount)))) + (all <>.and + (.field "patent retaliation?" .boolean) + (.field "termination period" ..amount) + (.field "grace period" ..amount)))) (def: liability (Parser Liability) (.object - ($_ <>.and - (.field "can accept?" .boolean) - (.field "disclaim high risk?" .boolean)))) + (all <>.and + (.field "can accept?" .boolean) + (.field "disclaim high risk?" .boolean)))) (def: distribution (Parser Distribution) (.object - ($_ <>.and - (.field "can re-license?" .boolean) - (.field "can multi-license?" .boolean)))) + (all <>.and + (.field "can re-license?" .boolean) + (.field "can multi-license?" .boolean)))) (def: commercial (Parser Commercial) (.object - ($_ <>.and - (.field "can sell?" .boolean) - (.field "require contributor credit?" .boolean) - (.field "allow contributor endorsement?" .boolean)))) + (all <>.and + (.field "can sell?" .boolean) + (.field "require contributor credit?" .boolean) + (.field "allow contributor endorsement?" .boolean)))) (def: extension (Parser Extension) (.object - ($_ <>.and - (.field "same license?" .boolean) - (.field "must be distinguishable?" .boolean) - (.field "notification period" (.nullable ..period)) - (.field "must describe modifications?" .boolean)))) + (all <>.and + (.field "same license?" .boolean) + (.field "must be distinguishable?" .boolean) + (.field "notification period" (.nullable ..period)) + (.field "must describe modifications?" .boolean)))) (def: entity (Parser Entity) @@ -126,9 +126,9 @@ (def: black_list (Parser Black_List) (.object - ($_ <>.and - (.field "justification" (.nullable .string)) - (.field "entities" (.array (<>.many ..entity)))))) + (all <>.and + (.field "justification" (.nullable .string)) + (.field "entities" (.array (<>.many ..entity)))))) (def: url (Parser URL) @@ -137,32 +137,32 @@ (def: attribution (Parser Attribution) (.object - ($_ <>.and - (.field "copyright-notice" .string) - (.field "phrase" (.nullable .string)) - (.field "url" ..url) - (.field "image" (.nullable ..url))))) + (all <>.and + (.field "copyright-notice" .string) + (.field "phrase" (.nullable .string)) + (.field "url" ..url) + (.field "image" (.nullable ..url))))) (def: addendum (Parser Addendum) (.object - ($_ <>.and - (.field "commons clause?" .boolean) - ))) + (all <>.and + (.field "commons clause?" .boolean) + ))) (def: .public license (Parser License) (.object - ($_ <>.and - (.field "copyright-holders" (.array (<>.many ..copyright_holder))) - (.field "identification" (.nullable ..identification)) - (.field "termination" ..termination) - (.field "liability" ..liability) - (.field "distribution" ..distribution) - (.field "commercial" ..commercial) - (.field "extension" ..extension) - (.field "black-lists" (.array (<>.some ..black_list))) - (.field "attribution" (.nullable ..attribution)) - (<>.default [//.#commons_clause? false] - (.field "addendum" ..addendum)) - ))) + (all <>.and + (.field "copyright-holders" (.array (<>.many ..copyright_holder))) + (.field "identification" (.nullable ..identification)) + (.field "termination" ..termination) + (.field "liability" ..liability) + (.field "distribution" ..distribution) + (.field "commercial" ..commercial) + (.field "extension" ..extension) + (.field "black-lists" (.array (<>.some ..black_list))) + (.field "attribution" (.nullable ..attribution)) + (<>.default [//.#commons_clause? false] + (.field "addendum" ..addendum)) + ))) diff --git a/licentia/source/program/licentia/license/distribution.lux b/licentia/source/program/licentia/license/distribution.lux index 849b7294a..87b397ff7 100644 --- a/licentia/source/program/licentia/license/distribution.lux +++ b/licentia/source/program/licentia/license/distribution.lux @@ -104,10 +104,10 @@ (def: .public (extension distribution) (-> Distribution Text) - ($.paragraph ($_ list#composite - (if (the //.#can_re_license? distribution) - (list allow_re_licensing) - (list)) - (if (the //.#can_multi_license? distribution) - (list allow_multi_licensing) - (list))))) + ($.paragraph (all list#composite + (if (the //.#can_re_license? distribution) + (list allow_re_licensing) + (list)) + (if (the //.#can_multi_license? distribution) + (list allow_multi_licensing) + (list))))) diff --git a/licentia/source/test/licentia.lux b/licentia/source/test/licentia.lux index c753cd555..c24c1231e 100644 --- a/licentia/source/test/licentia.lux +++ b/licentia/source/test/licentia.lux @@ -58,49 +58,49 @@ (def: copyright_holder (Random copyright.Holder) - ($_ random.and - (random.ascii 10) - ..period)) + (all random.and + (random.ascii 10) + ..period)) (def: identification (Random Identification) - ($_ random.and - (random.ascii 10) - (random.ascii 10))) + (all random.and + (random.ascii 10) + (random.ascii 10))) (def: termination (Random Termination) - ($_ random.and - random.bit - random.nat - random.nat)) + (all random.and + random.bit + random.nat + random.nat)) (def: liability (Random Liability) - ($_ random.and - random.bit - random.bit)) + (all random.and + random.bit + random.bit)) (def: distribution (Random Distribution) - ($_ random.and - random.bit - random.bit)) + (all random.and + random.bit + random.bit)) (def: commercial (Random Commercial) - ($_ random.and - random.bit - random.bit - random.bit)) + (all random.and + random.bit + random.bit + random.bit)) (def: extension (Random Extension) - ($_ random.and - random.bit - random.bit - (random.maybe ..period) - random.bit)) + (all random.and + random.bit + random.bit + (random.maybe ..period) + random.bit)) (def: entity (Random Entity) @@ -115,9 +115,9 @@ (def: black_list (Random Black_List) - ($_ random.and - (random.maybe (random.ascii 10)) - (variable_list 10 ..entity))) + (all random.and + (random.maybe (random.ascii 10)) + (variable_list 10 ..entity))) (def: url (Random URL) @@ -125,163 +125,163 @@ (def: attribution (Random Attribution) - ($_ random.and - (random.ascii 10) - (random.maybe (random.ascii 10)) - ..url - (random.maybe ..url))) + (all random.and + (random.ascii 10) + (random.maybe (random.ascii 10)) + ..url + (random.maybe ..url))) (def: addendum (Random Addendum) - ($_ random.and - random.bit - )) + (all random.and + random.bit + )) (def: license (Random License) - ($_ random.and - (random.list 2 ..copyright_holder) - (random.maybe ..identification) - ..termination - ..liability - ..distribution - ..commercial - ..extension - (variable_list 3 ..black_list) - (random.maybe attribution) - ..addendum - )) + (all random.and + (random.list 2 ..copyright_holder) + (random.maybe ..identification) + ..termination + ..liability + ..distribution + ..commercial + ..extension + (variable_list 3 ..black_list) + (random.maybe attribution) + ..addendum + )) (type: (Concern a) (-> (-> Text Bit) a Test)) (def: (about_grant present? termination) (Concern Termination) - ($_ _.and - (_.test "Copyright grant is present." - (present? grant.copyright)) - (_.test "Patent grant is present." - (present? (grant.patent (the license.#patent_retaliation? termination)))) - (_.test "Effective date for the grants is present." - (present? grant.date)) - (_.test "Patent grant is present." - (present? (grant.termination (the license.#termination_period termination) - (the license.#grace_period termination)))) - (_.test "The termination period is accurately conveyed." - (present? (grant.grant_restoration_clause (the license.#termination_period termination)))) - (_.test "The grace period is accurately conveyed." - (present? (grant.grace_period_clause (the license.#grace_period termination)))) - (_.test "The grants are not retro-actively terminated." - (present? grant.no_retroactive_termination)) - )) + (all _.and + (_.test "Copyright grant is present." + (present? grant.copyright)) + (_.test "Patent grant is present." + (present? (grant.patent (the license.#patent_retaliation? termination)))) + (_.test "Effective date for the grants is present." + (present? grant.date)) + (_.test "Patent grant is present." + (present? (grant.termination (the license.#termination_period termination) + (the license.#grace_period termination)))) + (_.test "The termination period is accurately conveyed." + (present? (grant.grant_restoration_clause (the license.#termination_period termination)))) + (_.test "The grace period is accurately conveyed." + (present? (grant.grace_period_clause (the license.#grace_period termination)))) + (_.test "The grants are not retro-actively terminated." + (present? grant.no_retroactive_termination)) + )) (def: (about_liability present? liability) (Concern Liability) - ($_ _.and - (_.test "Warranty liability disclaimer is present." - (present? liability.warranty)) - (_.test "Limitation of liability is present." - (present? liability.limitation)) - (_.test "Litigation conditions are present." - (present? liability.litigation)) - (_.test "Liability acceptance conditions may be present." - (bit#= (the license.#can_accept? liability) - (present? liability.can_accept))) - (_.test "Liability acceptance conditions may be present." - (bit#= (the license.#disclaim_high_risk? liability) - (present? liability.disclaim_high_risk))) - )) + (all _.and + (_.test "Warranty liability disclaimer is present." + (present? liability.warranty)) + (_.test "Limitation of liability is present." + (present? liability.limitation)) + (_.test "Litigation conditions are present." + (present? liability.litigation)) + (_.test "Liability acceptance conditions may be present." + (bit#= (the license.#can_accept? liability) + (present? liability.can_accept))) + (_.test "Liability acceptance conditions may be present." + (bit#= (the license.#disclaim_high_risk? liability) + (present? liability.disclaim_high_risk))) + )) (def: (about_distribution present? distribution) (Concern Distribution) - ($_ _.and - (_.test "Conditions for source-code distribution are present." - (present? distribution.source_code_form)) - (_.test "Conditions for object-code distribution are present." - (present? distribution.object_form)) - (_.test "Conditions for extension distribution are present." - (present? (distribution.extension distribution))) - )) + (all _.and + (_.test "Conditions for source-code distribution are present." + (present? distribution.source_code_form)) + (_.test "Conditions for object-code distribution are present." + (present? distribution.object_form)) + (_.test "Conditions for extension distribution are present." + (present? (distribution.extension distribution))) + )) (def: (about_commercial present? commercial) (Concern Commercial) - ($_ _.and - (_.test "Non-commercial clause is present." - (bit#= (not (the license.#can_sell? commercial)) - (present? commercial.cannot_sell))) - (_.test "Contributor credit condition is present." - (bit#= (the license.#require_contributor_credit? commercial) - (present? commercial.require_contributor_attribution))) - (_.test "Anti-endorsement condition is present." - (bit#= (not (the license.#allow_contributor_endorsement? commercial)) - (present? commercial.disallow_contributor_endorsement))) - )) + (all _.and + (_.test "Non-commercial clause is present." + (bit#= (not (the license.#can_sell? commercial)) + (present? commercial.cannot_sell))) + (_.test "Contributor credit condition is present." + (bit#= (the license.#require_contributor_credit? commercial) + (present? commercial.require_contributor_attribution))) + (_.test "Anti-endorsement condition is present." + (bit#= (not (the license.#allow_contributor_endorsement? commercial)) + (present? commercial.disallow_contributor_endorsement))) + )) (def: (about_extension present? extension) (Concern Extension) - ($_ _.and - (_.test "The license is viral." - (bit#= (the 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#= (the license.#must_be_distinguishable? extension) - (present? extension.distinctness_requirement))) - (_.test "The community must be notified of new extensions." - (case (the license.#notification_period extension) - {.#Some period} - (present? (extension.notification_requirement period)) - - {.#None} - true)) - (_.test "Must describe modifications." - (bit#= (the license.#must_describe_modifications? extension) - (present? extension.description_requirement))) - )) + (all _.and + (_.test "The license is viral." + (bit#= (the 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#= (the license.#must_be_distinguishable? extension) + (present? extension.distinctness_requirement))) + (_.test "The community must be notified of new extensions." + (case (the license.#notification_period extension) + {.#Some period} + (present? (extension.notification_requirement period)) + + {.#None} + true)) + (_.test "Must describe modifications." + (bit#= (the license.#must_describe_modifications? extension) + (present? extension.description_requirement))) + )) (def: (about_attribution present? attribution) (Concern Attribution) - ($_ _.and - (_.test "The attribution copyright notice is present." - (present? (the license.#copyright_notice attribution))) - (_.test "The attribution phrase is present." - (|> attribution - (the license.#phrase) - (maybe#each present?) - (maybe.default true))) - (_.test "The attribution URL is present." - (present? (the license.#url attribution))) - (_.test "The attribution image is present." - (|> attribution - (the license.#image) - (maybe#each present?) - (maybe.default true))) - )) + (all _.and + (_.test "The attribution copyright notice is present." + (present? (the license.#copyright_notice attribution))) + (_.test "The attribution phrase is present." + (|> attribution + (the license.#phrase) + (maybe#each present?) + (maybe.default true))) + (_.test "The attribution URL is present." + (present? (the license.#url attribution))) + (_.test "The attribution image is present." + (|> attribution + (the license.#image) + (maybe#each present?) + (maybe.default true))) + )) (def: (about_miscellaneous present?) (-> (-> Text Bit) Test) - ($_ _.and - (_.test "License constitutes the entire agreement." - (present? miscellaneous.entire_agreement)) - (_.test "Disclaims relationship of parties." - (present? miscellaneous.relationship_of_parties)) - (_.test "Explicitly allows independent development." - (present? miscellaneous.independent_development)) - (_.test "Clarifies consent to breach does not waiver." - (present? miscellaneous.not_waiver)) - (_.test "Provides severability." - (present? miscellaneous.severability)) - (_.test "Covers export restrictions." - (present? miscellaneous.export_restrictions)) - )) + (all _.and + (_.test "License constitutes the entire agreement." + (present? miscellaneous.entire_agreement)) + (_.test "Disclaims relationship of parties." + (present? miscellaneous.relationship_of_parties)) + (_.test "Explicitly allows independent development." + (present? miscellaneous.independent_development)) + (_.test "Clarifies consent to breach does not waiver." + (present? miscellaneous.not_waiver)) + (_.test "Provides severability." + (present? miscellaneous.severability)) + (_.test "Covers export restrictions." + (present? miscellaneous.export_restrictions)) + )) (def: (about_addendum present? value) (Concern Addendum) - ($_ _.and - (_.test "Commons clause" - (bit#= (the license.#commons_clause? value) - (present? addendum.commons_clause))) - )) + (all _.and + (_.test "Commons clause" + (bit#= (the license.#commons_clause? value) + (present? addendum.commons_clause))) + )) (def: test Test @@ -291,77 +291,77 @@ present? (is (-> Text Bit) (function (_ snippet) (text.contains? snippet writ)))]] - ($_ _.and - (_.test "Copyright notices are present." - (list.every? (|>> notice.copyright_holder present?) - (the license.#copyright_holders license))) - - (_.test "Identification is present (if the license is identified)." - (case (the license.#identification license) - {.#Some identification} - (and (present? (output.identification identification)) - (present? miscellaneous.new_versions)) - - {.#None} - (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 (the license.#justification black_list) - {.#Some justification} - (present? justification) - - {.#None} - bit.yes) - every_entity_is_mentioned? (|> black_list - (the license.#entities) - (list#each black_list.entity) - (list.every? present?))] - (and black_list_is_justified? - every_entity_is_mentioned?))) - (the license.#black_lists license))) - - (_.test "All definitions are present." - (list.every? (|>> output.definition present?) - definition.all)) - - (_.test "Acceptance of the license is demanded." - (present? limitation.acceptance)) - - (..about_grant present? (the license.#termination license)) - - (_.test "All limitations are present." - (present? output.limitation)) - - (_.test "All assurances are present." - (present? output.assurance)) - - (_.test "The terms of submission are present." - (present? submission.contribution)) - - (..about_liability present? (the license.#liability license)) - - (..about_distribution present? (the license.#distribution license)) - - (..about_commercial present? (the license.#commercial license)) - - (..about_extension present? (the license.#extension license)) - - (case (the license.#attribution license) - {.#Some attribution} - (..about_attribution present? attribution) - - {.#None} - (_.test "Attribution is missing." - bit.yes)) - - (..about_miscellaneous present?) - - (..about_addendum present? (the license.#addendum license)) - - (_.test "License ending footer is present." - (present? notice.end_of_license)) - ))) + (all _.and + (_.test "Copyright notices are present." + (list.every? (|>> notice.copyright_holder present?) + (the license.#copyright_holders license))) + + (_.test "Identification is present (if the license is identified)." + (case (the license.#identification license) + {.#Some identification} + (and (present? (output.identification identification)) + (present? miscellaneous.new_versions)) + + {.#None} + (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 (the license.#justification black_list) + {.#Some justification} + (present? justification) + + {.#None} + bit.yes) + every_entity_is_mentioned? (|> black_list + (the license.#entities) + (list#each black_list.entity) + (list.every? present?))] + (and black_list_is_justified? + every_entity_is_mentioned?))) + (the license.#black_lists license))) + + (_.test "All definitions are present." + (list.every? (|>> output.definition present?) + definition.all)) + + (_.test "Acceptance of the license is demanded." + (present? limitation.acceptance)) + + (..about_grant present? (the license.#termination license)) + + (_.test "All limitations are present." + (present? output.limitation)) + + (_.test "All assurances are present." + (present? output.assurance)) + + (_.test "The terms of submission are present." + (present? submission.contribution)) + + (..about_liability present? (the license.#liability license)) + + (..about_distribution present? (the license.#distribution license)) + + (..about_commercial present? (the license.#commercial license)) + + (..about_extension present? (the license.#extension license)) + + (case (the license.#attribution license) + {.#Some attribution} + (..about_attribution present? attribution) + + {.#None} + (_.test "Attribution is missing." + bit.yes)) + + (..about_miscellaneous present?) + + (..about_addendum present? (the license.#addendum license)) + + (_.test "License ending footer is present." + (present? notice.end_of_license)) + ))) (program: args (<| io.io -- cgit v1.2.3