aboutsummaryrefslogtreecommitdiff
path: root/module/sets.m
diff options
context:
space:
mode:
authorbhgv <bhgv.empire@gmail.com>2018-03-01 16:54:45 +0200
committerbhgv <bhgv.empire@gmail.com>2018-03-01 16:54:45 +0200
commitb786f20bbab5a59046aa78a2c6c2a11536497202 (patch)
tree0851ecdec889eb9b7ba3751cc04d4f0b474e4a9e /module/sets.m
inferno-os tree was separated from the inferno-os-android (separated from the Android driver)
Diffstat (limited to 'module/sets.m')
-rw-r--r--module/sets.m34
1 files changed, 34 insertions, 0 deletions
diff --git a/module/sets.m b/module/sets.m
new file mode 100644
index 0000000..aae6715
--- /dev/null
+++ b/module/sets.m
@@ -0,0 +1,34 @@
+Sets: module {
+ A: con 2r1010;
+ B: con 2r1100;
+
+ PATH: con "/dis/lib/sets.dis";
+
+ init: fn();
+ set: fn(): Set;
+ str2set: fn(str: string): Set;
+ bytes2set: fn(d: array of byte): Set;
+ Set: adt {
+ m: int;
+ a: array of int;
+
+ X: fn(s1: self Set, o: int, s2: Set): Set;
+ add: fn(s: self Set, n: int): Set;
+ addlist: fn(s: self Set, ns: list of int): Set;
+ # dellist: fn(s: self Set, ns: list of int): Set;
+ del: fn(s: self Set, n: int): Set;
+ invert: fn(s: self Set): Set;
+
+ eq: fn(s1: self Set, s2: Set): int;
+ holds: fn(s: self Set, n: int): int;
+ isempty: fn(s: self Set): int;
+ msb: fn(s: self Set): int;
+ limit: fn(s: self Set): int;
+
+ str: fn(s: self Set): string;
+ bytes: fn(s: self Set, n: int): array of byte;
+ debugstr: fn(s: self Set): string;
+ };
+ All: con Set(~0, nil);
+ None: con Set(0, nil);
+};