From a67cde69bb399684c7830f81c8baa4913d8c92cd Mon Sep 17 00:00:00 2001 From: Kyle Marek-Spartz Date: Sun, 16 Feb 2014 12:02:45 -0600 Subject: [PATCH] Update set example to use bitwise operators --- example/set.wren | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/example/set.wren b/example/set.wren index 1c298767..69362608 100644 --- a/example/set.wren +++ b/example/set.wren @@ -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