1
0
forked from Mirror/wren

Update set example to use bitwise operators

This commit is contained in:
Kyle Marek-Spartz
2014-02-16 12:02:45 -06:00
committed by Kyle Marek-Spartz
parent 18af6514f0
commit a67cde69bb

View File

@ -68,27 +68,25 @@ class Set {
return new Set(_list.where(f))
}
/*| that {
| that {
// Union
}*/
return new Set(_list + that)
}
+ that {
// A synonym for |
return new Set(_list + that)
// return this | that
return this | that
}
/* & that {
& that {
// Intersection
return new Set(
_list.where(fn (element) {
return that.contains(element)
}) + that.where(fn (element) {
return _list.contains(element)
})
)
} */
}))
}
- that {
// Set minus