summaryrefslogtreecommitdiff
path: root/lib/inifile/types.myr
diff options
context:
space:
mode:
Diffstat (limited to 'lib/inifile/types.myr')
-rw-r--r--lib/inifile/types.myr23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/inifile/types.myr b/lib/inifile/types.myr
index f573b7b..f2736e0 100644
--- a/lib/inifile/types.myr
+++ b/lib/inifile/types.myr
@@ -11,4 +11,27 @@ pkg inifile =
sects : byte[:][:]
elts : std.htab((byte[:], byte[:]), byte[:])#
;;
+
+ impl std.hashable (byte[:], byte[:])
+ impl std.comparable (byte[:], byte[:])
+;;
+
+impl std.hashable (byte[:], byte[:]) =
+ hash = {k
+ var sect, key
+
+ (sect, key) = k
+ -> std.hash(sect) ^ std.hash(key)
+ }
+;;
+
+impl std.comparable (byte[:], byte[:]) =
+ cmp = {a, b
+ var s1, k1
+ var s2, k2
+
+ (s1, k1) = a
+ (s2, k2) = a
+ -> std.cmp(s1, s2) && std.cmp(k1, k2)
+ }
;;