From b71b861008381626633bf28b033cd866d7e4e0b7 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 20 Jun 2019 22:32:59 -0400 Subject: Improved the convention for using text formatters. --- stdlib/source/program/compositor.lux | 2 +- stdlib/source/program/licentia.lux | 2 +- stdlib/source/program/licentia/document.lux | 2 +- stdlib/source/program/licentia/input.lux | 10 ++-- .../source/program/licentia/license/assurance.lux | 2 +- .../source/program/licentia/license/black-list.lux | 4 +- .../source/program/licentia/license/commercial.lux | 2 +- .../source/program/licentia/license/definition.lux | 2 +- .../program/licentia/license/distribution.lux | 2 +- .../source/program/licentia/license/extension.lux | 8 +-- stdlib/source/program/licentia/license/grant.lux | 6 +-- .../source/program/licentia/license/liability.lux | 2 +- .../source/program/licentia/license/limitation.lux | 2 +- .../program/licentia/license/miscellaneous.lux | 2 +- stdlib/source/program/licentia/license/notice.lux | 6 +-- .../source/program/licentia/license/submission.lux | 2 +- stdlib/source/program/licentia/license/term.lux | 57 ++++++++++------------ stdlib/source/program/licentia/output.lux | 2 +- stdlib/source/program/scriptum.lux | 20 ++++---- 19 files changed, 66 insertions(+), 69 deletions(-) (limited to 'stdlib/source/program') diff --git a/stdlib/source/program/compositor.lux b/stdlib/source/program/compositor.lux index 506702706..ef11ab060 100644 --- a/stdlib/source/program/compositor.lux +++ b/stdlib/source/program/compositor.lux @@ -13,7 +13,7 @@ ["." product] ["." error (#+ Error)] ["." text - format] + ["%" format (#+ format)]] [collection ["." dictionary] ["." row] diff --git a/stdlib/source/program/licentia.lux b/stdlib/source/program/licentia.lux index 482777503..7f19a829c 100644 --- a/stdlib/source/program/licentia.lux +++ b/stdlib/source/program/licentia.lux @@ -24,7 +24,7 @@ ["." maybe] ["." error (#+ Error)] ["." text - format + ["%" format (#+ format)] ["." encoding]] [format ["." json]]] diff --git a/stdlib/source/program/licentia/document.lux b/stdlib/source/program/licentia/document.lux index 1fd0189eb..b3787f2f2 100644 --- a/stdlib/source/program/licentia/document.lux +++ b/stdlib/source/program/licentia/document.lux @@ -2,7 +2,7 @@ [lux (#- or and) [data ["." text - format] + ["%" format (#+ format)]] [collection ["." list ("#;." functor)]]]]) diff --git a/stdlib/source/program/licentia/input.lux b/stdlib/source/program/licentia/input.lux index a10452f5b..7af7c33d4 100644 --- a/stdlib/source/program/licentia/input.lux +++ b/stdlib/source/program/licentia/input.lux @@ -6,7 +6,7 @@ ["." parser]] [data [text - format] + ["%" format (#+ format)]] [format ["." json (#+ Reader)]]]] [// @@ -30,10 +30,10 @@ (json.field "version" json.string)))) (exception: #export (cannot-use-fractional-amount {amount Frac}) - (ex.report ["Amount" (%f amount)])) + (ex.report ["Amount" (%.frac amount)])) (exception: #export (cannot-use-negative-amount {amount Int}) - (ex.report ["Amount" (%i amount)])) + (ex.report ["Amount" (%.int amount)])) (def: amount (Reader Nat) @@ -48,8 +48,8 @@ (wrap (.nat amountI)))) (exception: #export (invalid-period {period (Period Nat)}) - (ex.report ["Start" (%n (get@ #time.start period))] - ["End" (%n (get@ #time.end period))])) + (ex.report ["Start" (%.nat (get@ #time.start period))] + ["End" (%.nat (get@ #time.end period))])) (def: period (Reader (Period Nat)) diff --git a/stdlib/source/program/licentia/license/assurance.lux b/stdlib/source/program/licentia/license/assurance.lux index c75598962..155472cd1 100644 --- a/stdlib/source/program/licentia/license/assurance.lux +++ b/stdlib/source/program/licentia/license/assurance.lux @@ -2,7 +2,7 @@ [lux #* [data ["." text - format]]] + ["%" format (#+ format)]]]] [// ["_" term] [// diff --git a/stdlib/source/program/licentia/license/black-list.lux b/stdlib/source/program/licentia/license/black-list.lux index ac5ab8a2c..a71ceda9c 100644 --- a/stdlib/source/program/licentia/license/black-list.lux +++ b/stdlib/source/program/licentia/license/black-list.lux @@ -3,7 +3,7 @@ [data ["." maybe ("#;." functor)] ["." text - format] + ["%" format (#+ format)]] [collection ["." list ("#;." functor)]]]] ["." // (#+ Entity Black-List) @@ -13,7 +13,7 @@ (def: #export entity (-> Entity Text) - %t) + %.text) (def: #export (black-list black-list) (-> Black-List Text) diff --git a/stdlib/source/program/licentia/license/commercial.lux b/stdlib/source/program/licentia/license/commercial.lux index 787d92034..f05bcf470 100644 --- a/stdlib/source/program/licentia/license/commercial.lux +++ b/stdlib/source/program/licentia/license/commercial.lux @@ -2,7 +2,7 @@ [lux #* [data ["." text - format] + ["%" format (#+ format)]] [collection ["." list ("#;." monoid)]]]] ["." // (#+ Commercial) diff --git a/stdlib/source/program/licentia/license/definition.lux b/stdlib/source/program/licentia/license/definition.lux index fea7b91f4..6739039dc 100644 --- a/stdlib/source/program/licentia/license/definition.lux +++ b/stdlib/source/program/licentia/license/definition.lux @@ -2,7 +2,7 @@ [lux (#- Definition) [data ["." text - format]]] + ["%" format (#+ format)]]]] [/// ["$" document]]) diff --git a/stdlib/source/program/licentia/license/distribution.lux b/stdlib/source/program/licentia/license/distribution.lux index 077735b2c..58eaab22d 100644 --- a/stdlib/source/program/licentia/license/distribution.lux +++ b/stdlib/source/program/licentia/license/distribution.lux @@ -2,7 +2,7 @@ [lux #* [data ["." text - format] + ["%" format (#+ format)]] [collection ["." list ("#;." monoid)]]]] ["." // (#+ Distribution) diff --git a/stdlib/source/program/licentia/license/extension.lux b/stdlib/source/program/licentia/license/extension.lux index 83da58873..68b5f6669 100644 --- a/stdlib/source/program/licentia/license/extension.lux +++ b/stdlib/source/program/licentia/license/extension.lux @@ -2,7 +2,7 @@ [lux #* [data ["." text - format] + ["%" format (#+ format)]] [collection ["." list ("#;." monoid)]]]] ["." // (#+ Extension) @@ -93,7 +93,7 @@ " must notify the software community of the availability of the " _.source-code-form " to any " _.extension " created by " _.recipient - " within " (%n start) + " within " (%.nat start) " month(s) of the date " _.recipient " initially does " _.deploy ", and include in such notification a description of the " _.extension @@ -101,7 +101,7 @@ " via an " _.electronic-distribution-mechanism) on-duration (format "The " _.source-code-form " must remain available via an " _.electronic-distribution-mechanism - " for no less than " (%n end) + " for no less than " (%.nat end) " month(s) after the date " _.recipient " ceases to " _.deploy) on-responsibility (format _.recipient @@ -116,7 +116,7 @@ " in excess of the actual cost of duplication and distribution of said copy that " _.recipient " incurs") on-changes (format "Should such instructions change, " _.recipient - " must notify the software community of revised instructions within " (%n start) + " 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) diff --git a/stdlib/source/program/licentia/license/grant.lux b/stdlib/source/program/licentia/license/grant.lux index 1725755b7..0f45f3592 100644 --- a/stdlib/source/program/licentia/license/grant.lux +++ b/stdlib/source/program/licentia/license/grant.lux @@ -2,7 +2,7 @@ [lux #* [data ["." text - format]]] + ["%" format (#+ format)]]]] [// [time (#+ Days)] ["_" term] @@ -83,7 +83,7 @@ " explicitly and finally terminates the grants to " _.recipient) complaint-period-condition (format "such " _.contributor " fails to notify " _.recipient - " of the non-compliance by some reasonable means prior to " (%n 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" @@ -100,7 +100,7 @@ " has received notice of non-compliance with " _.license " from such " _.contributor) prompt-compliance (format _.recipient - " becomes compliant prior to " (%n grace-period) + " becomes compliant prior to " (%.nat grace-period) " " ($.plural "day") " after reception of the notice")] ($.and (list notification first-offense diff --git a/stdlib/source/program/licentia/license/liability.lux b/stdlib/source/program/licentia/license/liability.lux index 598341449..51b98ad40 100644 --- a/stdlib/source/program/licentia/license/liability.lux +++ b/stdlib/source/program/licentia/license/liability.lux @@ -2,7 +2,7 @@ [lux #* [data ["." text - format]]] + ["%" format (#+ format)]]]] [// ["_" term] [// diff --git a/stdlib/source/program/licentia/license/limitation.lux b/stdlib/source/program/licentia/license/limitation.lux index 602a4f163..1617d9909 100644 --- a/stdlib/source/program/licentia/license/limitation.lux +++ b/stdlib/source/program/licentia/license/limitation.lux @@ -2,7 +2,7 @@ [lux #* [data ["." text - format]]] + ["%" format (#+ format)]]]] [// ["_" term] [// diff --git a/stdlib/source/program/licentia/license/miscellaneous.lux b/stdlib/source/program/licentia/license/miscellaneous.lux index a04e3e1e2..03adb1462 100644 --- a/stdlib/source/program/licentia/license/miscellaneous.lux +++ b/stdlib/source/program/licentia/license/miscellaneous.lux @@ -2,7 +2,7 @@ [lux #* [data ["." text - format]]] + ["%" format (#+ format)]]]] [// ["_" term] [// diff --git a/stdlib/source/program/licentia/license/notice.lux b/stdlib/source/program/licentia/license/notice.lux index 7e775078c..947669035 100644 --- a/stdlib/source/program/licentia/license/notice.lux +++ b/stdlib/source/program/licentia/license/notice.lux @@ -2,7 +2,7 @@ [lux #* [data ["." text - format] + ["%" format (#+ format)]] [collection ["." list ("#;." functor)]]]] ["." // #_ @@ -20,8 +20,8 @@ (let [(^slots [#//time.start #//time.end]) (get@ #//copyright.period holder) single-year? (n/= start end) period-section (if single-year? - (%n start) - (format (%n start) "-" (%n end)))] + (%.nat start) + (format (%.nat start) "-" (%.nat end)))] (format "Copyright (C) " period-section " " (get@ #//copyright.name holder)))) (def: #export copyright diff --git a/stdlib/source/program/licentia/license/submission.lux b/stdlib/source/program/licentia/license/submission.lux index d700c1c1c..855141690 100644 --- a/stdlib/source/program/licentia/license/submission.lux +++ b/stdlib/source/program/licentia/license/submission.lux @@ -2,7 +2,7 @@ [lux #* [data ["." text - format]]] + ["%" format (#+ format)]]]] [// ["_" term] [// diff --git a/stdlib/source/program/licentia/license/term.lux b/stdlib/source/program/licentia/license/term.lux index 31b3e4b5d..54b3b1cc4 100644 --- a/stdlib/source/program/licentia/license/term.lux +++ b/stdlib/source/program/licentia/license/term.lux @@ -1,37 +1,34 @@ (.module: - [lux (#- Definition) - [data - ["." text - format]]] - [// - ["." definition]]) + [lux (#- Definition)] + ["." // #_ + ["#." definition]]) (template [ ] [(def: #export Text - (get@ #definition.term ))] + (get@ #//definition.term ))] - [source-code-form definition.source-code-form] - [object-form definition.object-form] - [license definition.license] - [licensable definition.licensable] - [legal-entity definition.legal-entity] - [recipient definition.recipient] - [licensor definition.licensor] - [work definition.work] - [derivative-work definition.derivative-work] - [submission definition.submission] - [modification definition.modification] - [required-component definition.required-component] - [extension definition.extension] - [contribution definition.contribution] - [contributor definition.contributor] - [patent-claim definition.patent-claim] - [secondary-license definition.secondary-license] - [sell definition.sell] - [personal-use definition.personal-use] - [serve definition.serve] - [research definition.research] - [deploy definition.deploy] - [electronic-distribution-mechanism definition.electronic-distribution-mechanism] + [source-code-form //definition.source-code-form] + [object-form //definition.object-form] + [license //definition.license] + [licensable //definition.licensable] + [legal-entity //definition.legal-entity] + [recipient //definition.recipient] + [licensor //definition.licensor] + [work //definition.work] + [derivative-work //definition.derivative-work] + [submission //definition.submission] + [modification //definition.modification] + [required-component //definition.required-component] + [extension //definition.extension] + [contribution //definition.contribution] + [contributor //definition.contributor] + [patent-claim //definition.patent-claim] + [secondary-license //definition.secondary-license] + [sell //definition.sell] + [personal-use //definition.personal-use] + [serve //definition.serve] + [research //definition.research] + [deploy //definition.deploy] + [electronic-distribution-mechanism //definition.electronic-distribution-mechanism] ) diff --git a/stdlib/source/program/licentia/output.lux b/stdlib/source/program/licentia/output.lux index 43080697e..05d68ff76 100644 --- a/stdlib/source/program/licentia/output.lux +++ b/stdlib/source/program/licentia/output.lux @@ -3,7 +3,7 @@ [data ["." maybe ("#;." functor)] ["." text - format] + ["%" format (#+ format)]] [collection ["." list ("#;." functor monoid)]]]] [// diff --git a/stdlib/source/program/scriptum.lux b/stdlib/source/program/scriptum.lux index 1522e8f66..569371900 100644 --- a/stdlib/source/program/scriptum.lux +++ b/stdlib/source/program/scriptum.lux @@ -15,7 +15,7 @@ [format ["md" markdown (#+ Markdown Span Block)]] ["." text ("#;." equivalence) - format + ["%" format (#+ format)] ["." encoding]] [collection ["." sequence (#+ Sequence) ("#;." functor)] @@ -104,10 +104,10 @@ [_ (#.Primitive name params)] (case params #.Nil - (format "(primitive " (%t name) ")") + (format "(primitive " (%.text name) ")") _ - (format "(primitive " (%t name) " " (|> params (list;map (pprint-type-definition level type-func-info #.None module signature? recursive-type?)) (text.join-with " ")) ")")) + (format "(primitive " (%.text name) " " (|> params (list;map (pprint-type-definition level type-func-info #.None module signature? recursive-type?)) (text.join-with " ")) ")")) [_ (#.Sum _)] (let [members (type.flatten-variant type)] @@ -166,7 +166,7 @@ (^template [
 ]
         [_ ( id)]
-        (format 
 (%n id) ))
+        (format 
 (%.nat id) ))
       ([#.Var "⌈v:" "⌋"]
        [#.Ex  "⟨e:" "⟩"])
 
@@ -196,7 +196,7 @@
       [_ (#.Named [_module _name] type)]
       (if (text;= module _module)
         _name
-        (%name [_module _name]))
+        (%.name [_module _name]))
       )))
 
 (def: (pprint-type level type-func-name module type)
@@ -205,10 +205,10 @@
     (#.Primitive name params)
     (case params
       #.Nil
-      (format "(primitive " (%t name) ")")
+      (format "(primitive " (%.text name) ")")
 
       _
-      (format "(primitive " (%t name) " " (|> params (list;map (pprint-type level type-func-name module)) (list.interpose " ") (text.join-with "")) ")"))
+      (format "(primitive " (%.text name) " " (|> params (list;map (pprint-type level type-func-name module)) (list.interpose " ") (text.join-with "")) ")"))
 
     (#.Sum _)
     (let [members (type.flatten-variant type)]
@@ -231,7 +231,7 @@
 
     (^template [ 
 ]
       ( id)
-      (format 
 (%n id) ))
+      (format 
 (%.nat id) ))
     ([#.Var "⌈" "⌋"]
      [#.Ex  "⟨" "⟩"])
 
@@ -253,7 +253,7 @@
     (#.Named [_module _name] type)
     (if (text;= module _module)
       _name
-      (%name [_module _name]))
+      (%.name [_module _name]))
     ))
 
 (type: (Mutation a)
@@ -337,7 +337,7 @@
     type))
 
 (exception: #export (anonymous-type-definition {type Type})
-  (ex.report ["Type" (%type type)]))
+  (ex.report ["Type" (%.type type)]))
 
 (def: (document-type module type def-annotations)
   (-> Text Type Code (Meta (Markdown Block)))
-- 
cgit v1.2.3