|
@@ -196,6 +196,34 @@ referencedClasses: []
|
|
|
}),
|
|
|
smalltalk.Collection);
|
|
|
|
|
|
+smalltalk.addMethod(
|
|
|
+smalltalk.method({
|
|
|
+selector: "anySatisfy:",
|
|
|
+category: 'enumerating',
|
|
|
+fn: function (aBlock){
|
|
|
+var self=this;
|
|
|
+return smalltalk.withContext(function($ctx1) {
|
|
|
+var $1;
|
|
|
+var $early={};
|
|
|
+try {
|
|
|
+_st(self)._do_((function(each){
|
|
|
+return smalltalk.withContext(function($ctx2) {
|
|
|
+$1=_st(aBlock)._value_(each);
|
|
|
+if(smalltalk.assert($1)){
|
|
|
+throw $early=[true];
|
|
|
+};
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
|
|
|
+return false;
|
|
|
+}
|
|
|
+catch(e) {if(e===$early)return e[0]; throw e}
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"anySatisfy:",{aBlock:aBlock},smalltalk.Collection)})},
|
|
|
+args: ["aBlock"],
|
|
|
+source: "anySatisfy: aBlock\x0a\x09\x22Evaluate aBlock with the elements of the receiver.\x0a\x09If aBlock returns true for any element return true.\x0a\x09Otherwise return false.\x22\x0a\x0a\x09self do: [ :each | (aBlock value: each) ifTrue: [ ^ true ] ].\x0a\x09^ false",
|
|
|
+messageSends: ["do:", "ifTrue:", "value:"],
|
|
|
+referencedClasses: []
|
|
|
+}),
|
|
|
+smalltalk.Collection);
|
|
|
+
|
|
|
smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "asArray",
|
|
@@ -297,6 +325,24 @@ referencedClasses: []
|
|
|
}),
|
|
|
smalltalk.Collection);
|
|
|
|
|
|
+smalltalk.addMethod(
|
|
|
+smalltalk.method({
|
|
|
+selector: "contains:",
|
|
|
+category: 'enumerating',
|
|
|
+fn: function (aBlock){
|
|
|
+var self=this;
|
|
|
+return smalltalk.withContext(function($ctx1) {
|
|
|
+var $1;
|
|
|
+$1=_st(self)._anySatisfy_(aBlock);
|
|
|
+return $1;
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"contains:",{aBlock:aBlock},smalltalk.Collection)})},
|
|
|
+args: ["aBlock"],
|
|
|
+source: "contains: aBlock\x0a\x09^ self anySatisfy: aBlock",
|
|
|
+messageSends: ["anySatisfy:"],
|
|
|
+referencedClasses: []
|
|
|
+}),
|
|
|
+smalltalk.Collection);
|
|
|
+
|
|
|
smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "copyWith:",
|