aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/lang/compiler/meta/archive.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux/lang/compiler/meta/archive.lux31
1 files changed, 20 insertions, 11 deletions
diff --git a/stdlib/source/lux/lang/compiler/meta/archive.lux b/stdlib/source/lux/lang/compiler/meta/archive.lux
index fa3b91d7c..a3e9c0397 100644
--- a/stdlib/source/lux/lang/compiler/meta/archive.lux
+++ b/stdlib/source/lux/lang/compiler/meta/archive.lux
@@ -9,13 +9,14 @@
text/format
(coll (dictionary ["dict" unordered #+ Dict])))
(lang [type #+ :share])
- (type abstract))
- [////])
+ (type abstract)
+ (world [file #+ File]))
+ [//// #+ Version])
## Key
(type: #export Signature
{#name Ident
- #version Text})
+ #version Version})
(def: Equivalence<Signature>
(Equivalence Signature)
@@ -54,27 +55,35 @@
(ex.report ["Key" (describe (..signature key))]
["Signature" (describe signature)]))
+(type: #export Reference Text)
+
+(type: #export Descriptor
+ {#hash Nat
+ #file File
+ #references (List Reference)
+ #state Module-State})
+
(type: #export (Document d)
{#key (Key d)
- #hash Nat
- #value d})
+ #descriptor Descriptor
+ #content d})
-(def: #export (open expected [actual value])
+(def: #export (open expected [actual _descriptor content])
(All [d] (-> (Key d) (Document Any) (Error d)))
(if (:: Equivalence<Key> = expected actual)
(#error.Success (:share [e]
{(Key e)
expected}
{e
- value}))
+ content}))
(ex.throw invalid-key-for-document [expected actual])))
-(def: #export (close key signature hash value)
- (All [d] (-> (Key d) Signature Nat d (Error (Document d))))
+(def: #export (close key signature descriptor content)
+ (All [d] (-> (Key d) Signature Descriptor d (Error (Document d))))
(if (:: Equivalence<Signature> = (..signature key) signature)
(#error.Success {#key key
- #hash hash
- #value value})
+ #descriptor descriptor
+ #content content})
(ex.throw signature-does-not-match-key [key signature])))
## Archive