aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex
diff options
context:
space:
mode:
authorEduardo Julian2021-02-01 04:59:32 -0400
committerEduardo Julian2021-02-01 04:59:32 -0400
commit3d457763e34d4dd1992427b3918b351ac684adb7 (patch)
tree5e6ead8ab0c360d6c3eca5765b6be0be782709e2 /stdlib/source/program/aedifex
parent1797521191746640e761cc1b4973d46b8c403dee (diff)
Improved compilation of loops and pattern-matching for Python.
Diffstat (limited to '')
-rw-r--r--stdlib/source/program/aedifex/artifact/snapshot/version/value.lux42
-rw-r--r--stdlib/source/program/aedifex/artifact/value.lux47
2 files changed, 42 insertions, 47 deletions
diff --git a/stdlib/source/program/aedifex/artifact/snapshot/version/value.lux b/stdlib/source/program/aedifex/artifact/snapshot/version/value.lux
new file mode 100644
index 000000000..7356d897c
--- /dev/null
+++ b/stdlib/source/program/aedifex/artifact/snapshot/version/value.lux
@@ -0,0 +1,42 @@
+(.module:
+ [lux #*
+ [abstract
+ [equivalence (#+ Equivalence)]]
+ [data
+ ["." product]
+ ["." text
+ ["%" format]]]]
+ ["." /// (#+ Snapshot)
+ ["#." time]
+ ["#." stamp]])
+
+(type: #export Value
+ {#version Text
+ #snapshot Snapshot})
+
+(def: #export equivalence
+ (Equivalence Value)
+ ($_ product.equivalence
+ text.equivalence
+ ///.equivalence
+ ))
+
+(def: separator
+ "-")
+
+(def: #export snapshot
+ "SNAPSHOT")
+
+(def: #export (format (^slots [#version #snapshot]))
+ (%.Format Value)
+ (case snapshot
+ #///.Local
+ version
+
+ (#///.Remote stamp)
+ (let [(^slots [#///stamp.time #///stamp.build]) stamp]
+ (%.format (text.replace_all ..snapshot
+ (///time.format time)
+ version)
+ ..separator
+ (%.nat build)))))
diff --git a/stdlib/source/program/aedifex/artifact/value.lux b/stdlib/source/program/aedifex/artifact/value.lux
deleted file mode 100644
index 3e92dbf16..000000000
--- a/stdlib/source/program/aedifex/artifact/value.lux
+++ /dev/null
@@ -1,47 +0,0 @@
-(.module:
- [lux #*
- [abstract
- [equivalence (#+ Equivalence)]]
- [data
- ["." product]
- ["." text
- ["%" format]]
- [collection
- ["." list ("#\." functor)]]]
- [math
- [number
- ["." nat]]]
- [time
- ["." instant]]]
- [// (#+ Version)
- ["." 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
- nat.equivalence
- ))
-
-(def: separator
- "-")
-
-(def: snapshot
- "SNAPSHOT")
-
-(def: #export (format (^slots [#version #time_stamp #build]))
- (%.Format Value)
- (%.format (text.replace_all ..snapshot
- (time_stamp.format time_stamp)
- version)
- ..separator
- (%.nat build)))