mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-10 21:58:48 +01:00
Update set example to use bitwise operators
This commit is contained in:
committed by
Kyle Marek-Spartz
parent
18af6514f0
commit
a67cde69bb
@ -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
|
||||
|
||||
Reference in New Issue
Block a user