From 60430ee6dfffbeb220a3e8fee7336d54313467bc Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 5 Feb 2019 20:30:13 -0400 Subject: Folded license-making program (legislator) into the Lux project proper (as licentia). --- stdlib/source/program/licentia/license/notice.lux | 30 +++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 stdlib/source/program/licentia/license/notice.lux (limited to 'stdlib/source/program/licentia/license/notice.lux') diff --git a/stdlib/source/program/licentia/license/notice.lux b/stdlib/source/program/licentia/license/notice.lux new file mode 100644 index 000000000..320dd4d7c --- /dev/null +++ b/stdlib/source/program/licentia/license/notice.lux @@ -0,0 +1,30 @@ +(.module: + [lux #* + [data + ["." text + format] + [collection + [list ("list/." functor)]]]] + [// + ["//." time] + ["//." copyright] + ["_" term] + [// + ["$" document]]]) + +(def: #export end-of-license + ($.sentence "END OF TERMS AND CONDITIONS")) + +(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? + (%n start) + (format (%n start) "-" (%n end)))] + (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))) -- cgit v1.2.3