80
|
1 #{
|
|
2 main <- {
|
|
3 inset <- #["foo" "bar" "foobar" 1 2 3]
|
|
4 notin <- #["baz" "qux" "bazqux" 4 5 6]
|
|
5 myset <- sets hash
|
|
6 foreach: inset :idx el {
|
|
7 myset add: el
|
|
8 }
|
|
9 foreach: inset :idx el {
|
|
10 if: (myset contains?: el) {
|
|
11 print: "set contains " . el . "\n"
|
|
12 } else: {
|
|
13 print: "set doesn't contain " . el . "\n"
|
|
14 }
|
|
15 }
|
|
16 foreach: notin :idx el {
|
|
17 if: (myset contains?: el) {
|
|
18 print: "set contains " . el . "\n"
|
|
19 } else: {
|
|
20 print: "set doesn't contain " . el . "\n"
|
|
21 }
|
|
22 }
|
|
23 }
|
|
24 }
|