|
@@ -3579,6 +3579,25 @@ referencedClasses: []
|
|
|
}),
|
|
|
smalltalk.Set);
|
|
|
|
|
|
+smalltalk.addMethod(
|
|
|
+unescape('_select_'),
|
|
|
+smalltalk.method({
|
|
|
+selector: unescape('select%3A'),
|
|
|
+category: 'enumerating',
|
|
|
+fn: function (aBlock){
|
|
|
+var self=this;
|
|
|
+var collection=nil;
|
|
|
+collection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
|
|
|
+smalltalk.send(self, "_do_", [(function(each){return ((($receiver = smalltalk.send(aBlock, "_value_", [each])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(collection, "_add_", [each]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(collection, "_add_", [each]);})]));})]);
|
|
|
+return collection;
|
|
|
+return self;},
|
|
|
+args: ["aBlock"],
|
|
|
+source: unescape('select%3A%20aBlock%0A%09%7C%20collection%20%7C%0A%09collection%20%3A%3D%20self%20class%20new.%20%0A%09self%20do%3A%20%5B%3Aeach%20%7C%0A%09%09%28aBlock%20value%3A%20each%29%20ifTrue%3A%20%5B%0A%09%09%09collection%20add%3A%20each%5D%5D.%0A%09%5Ecollection'),
|
|
|
+messageSends: ["new", "class", "do:", "ifTrue:", "value:", "add:"],
|
|
|
+referencedClasses: []
|
|
|
+}),
|
|
|
+smalltalk.Set);
|
|
|
+
|
|
|
|
|
|
|
|
|
smalltalk.addClass('HashedCollection', smalltalk.Collection, [], 'Kernel-Collections');
|