aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex/artifact/value.lux
diff options
context:
space:
mode:
authorEduardo Julian2021-01-03 07:48:12 -0400
committerEduardo Julian2021-01-03 07:48:12 -0400
commitc03bd9f9787fb9f383c57b4ebb0fa9d49abbfaa1 (patch)
tree68a7f2f043eff00492ffe2b5e442bae98167a873 /stdlib/source/program/aedifex/artifact/value.lux
parent02d27daeacac74785c2b0f4d1ce03d432377a36e (diff)
Place the "program:" macro of "lux/control/parser/cli" in its own module.
Diffstat (limited to 'stdlib/source/program/aedifex/artifact/value.lux')
-rw-r--r--stdlib/source/program/aedifex/artifact/value.lux53
1 files changed, 53 insertions, 0 deletions
diff --git a/stdlib/source/program/aedifex/artifact/value.lux b/stdlib/source/program/aedifex/artifact/value.lux
new file mode 100644
index 000000000..eb5c33c22
--- /dev/null
+++ b/stdlib/source/program/aedifex/artifact/value.lux
@@ -0,0 +1,53 @@
+(.module:
+ [lux (#- Name Type)
+ [abstract
+ [equivalence (#+ Equivalence)]]
+ [data
+ ["." product]
+ ["." text
+ ["%" format]]
+ [format
+ ["." xml]]
+ [collection
+ ["." list ("#\." functor)]]]
+ [math
+ [number
+ ["n" nat]]]
+ ["." time (#+ Time)
+ ["." instant (#+ Instant)]
+ ["." date (#+ Date)]
+ ["." year]
+ ["." month]]]
+ [// (#+ Version)
+ [type (#+ Type)]
+ ["." time_stamp (#+ Time_Stamp)]])
+
+(type: #export Build
+ Nat)
+
+(type: #export Value
+ {#version Version
+ #time_stamp Time_Stamp
+ #build Build})
+
+(def: #export equivalence
+ (Equivalence Value)
+ ($_ product.equivalence
+ text.equivalence
+ instant.equivalence
+ n.equivalence
+ ))
+
+(def: separator
+ "-")
+
+(def: snapshot
+ "SNAPSHOT")
+
+(def: #export (format [version time_stamp build])
+ (%.Format Value)
+ (%.format (text.replace_all ..snapshot
+ (time_stamp.format time_stamp)
+ version)
+ ..separator
+ (%.nat build)))