-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathglok.m
36 lines (32 loc) · 989 Bytes
/
glok.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const Set <- immutable object Set
export function of [ElementType : Type] -> [r : SetType]
suchthat
ElementType *> immutable typeobject constraint
function = [constraint] -> [Boolean]
end constraint
where
SetType <- immutable typeobject SetType
operation create -> [AnIndividualSetType]
end SetType
where
AnIndividualSetType <- typeobject AnIndividualSetType
function contains [ElementType] -> [Boolean]
function = [AnIndividualSetType] -> [Boolean]
operation choose -> [ElementType]
end AnIndividualSetType
r <- class aSet
var x : ElementType
export function contains [e : ElementType] -> [r : Boolean]
r <- x = e
end contains
export function = [arg : AnIndividualSetType] -> [r : Boolean]
r <- arg.choose = x
end =
export operation choose -> [r : ElementType]
r <- x
end choose
end aSet
end of
end Set
const set1 <- Set.of[Integer]
const set2 <- Set.of[Character]