11 (* if put [] then no segfault, if [11] then segfault *)
12 method toset
= Obj.magic data
14 method empty
= {< data
= SetPt.empty
>}
15 method add e
= {< data
= SetPt.add e data
>}
16 method iter f
= SetPt.iter f data
18 if SetPt.is_empty data
20 else let el = SetPt.choose data
in Cons
(el, o#del
el)
22 method del e
= {< data
= SetPt.remove e data
>}
23 method mem e
= SetPt.mem e data
24 method null
= SetPt.is_empty data
26 method tolist
= SetPt.elements data
27 method length
= SetPt.cardinal data
29 method union s
= {< data
= SetPt.union data s#tosetpt
>}
30 method inter s
= {< data
= SetPt.inter data s#tosetpt
>}
31 method minus s
= {< data
= SetPt.diff data s#tosetpt
>}