Merge jv
authorMerge Script
Fri, 15 Jan 2016 06:50:38 +0100
branchjv
changeset 19027 d1a18f4568a8
parent 19024 ff8490c274b1 (current diff)
parent 19026 23b3c4c6c9e7 (diff)
child 19035 06aeb1259ba6
Merge
Method.st
SequenceableCollection.st
--- a/Method.st	Thu Jan 14 06:55:31 2016 +0100
+++ b/Method.st	Fri Jan 15 06:50:38 2016 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
@@ -726,37 +724,37 @@
 
     |cls oldPackage newPackage|
 
+    newPackage := aSymbol.
     aSymbol == PackageId noProjectID ifTrue:[
-	newPackage := nil
-    ] ifFalse:[
-	newPackage := aSymbol
+        Transcript showCR:'warning: unassigning method from any package'.
+        "/ newPackage := nil
     ].
 
     package ~~ newPackage ifTrue:[
-	oldPackage := package.
-	"/ this is required, because otherwise I would no longer be able to
-	"/ reconstruct my sourcecode (as the connection to the source-file is lost).
-	self makeLocalStringSource.
-	package := newPackage.
-
-	cls := self mclass.
-	"JV@2011-01-27: BUG FIX: method may be wrapped (breakpoint on it).
-	 Search for the wrapper, if none is found, return immediately
-	 (avoids DNU)"
-	cls isNil ifTrue:[
-	    | wrapper |
-
-	    wrapper := self wrapper.
-	    wrapper isNil ifTrue:[ ^ self ].
-	    cls := wrapper mclass.
-	    cls isNil ifTrue:[ ^ self ].
-	].
-
-	self changed:#package.                                              "/ will vanish
-	cls changed:#methodPackage with:self selector.                      "/ will vanish
-
-	Smalltalk changed:#projectOrganization with:(Array with:cls with:self with:oldPackage).
-	cls addChangeRecordForMethodPackage:self package:newPackage.
+        oldPackage := package.
+        "/ this is required, because otherwise I would no longer be able to
+        "/ reconstruct my sourcecode (as the connection to the source-file is lost).
+        self makeLocalStringSource.
+        package := newPackage.
+
+        cls := self mclass.
+        "JV@2011-01-27: BUG FIX: method may be wrapped (breakpoint on it).
+         Search for the wrapper, if none is found, return immediately
+         (avoids DNU)"
+        cls isNil ifTrue:[
+            | wrapper |
+
+            wrapper := self wrapper.
+            wrapper isNil ifTrue:[ ^ self ].
+            cls := wrapper mclass.
+            cls isNil ifTrue:[ ^ self ].
+        ].
+
+        self changed:#package.                                              "/ will vanish
+        cls changed:#methodPackage with:self selector.                      "/ will vanish
+
+        Smalltalk changed:#projectOrganization with:(Array with:cls with:self with:oldPackage).
+        cls addChangeRecordForMethodPackage:self package:newPackage.
     ]
 
     "Modified: / 23-11-2006 / 17:01:02 / cg"
--- a/SequenceableCollection.st	Thu Jan 14 06:55:31 2016 +0100
+++ b/SequenceableCollection.st	Fri Jan 15 06:50:38 2016 +0100
@@ -398,7 +398,6 @@
     ^ self == SequenceableCollection
 ! !
 
-
 !SequenceableCollection methodsFor:'Compatibility-Squeak'!
 
 allButFirst
@@ -711,7 +710,6 @@
     ^ self replaceFrom:start to:stop with:anArray startingAt:repStart
 ! !
 
-
 !SequenceableCollection methodsFor:'accessing'!
 
 after:anObject
@@ -5865,7 +5863,7 @@
      each the receiver and the argument, aSequenceableCollection.
      The second argument, aBlock must be a two-argument block.
      The collection argument must implement access via a numeric key 
-     and (new!!) the sizes must be the same."
+     and the sizes must be the same (this is a new check!!)."
 
     |stop  "{ Class: SmallInteger }" |
 
@@ -5880,7 +5878,7 @@
 
     "
      #(one two three four five six)
-        with:(1 to:10)
+        with:(1 to:6)
         do:[:el1 :el2 | Transcript show:el1; space; showCR:el2]
     "
 
@@ -5892,11 +5890,15 @@
      each the receiver and the argument, aSequenceableCollection.
      aBlock must be a three-argument block, which get elements from either collection and
      the index as arguments.
-     The collection argument must implement access via a numeric key."
+     The collection argument must implement access via a numeric key.
+     and the sizes must be the same (this is a new check!!)."
 
     |stop  "{ Class: SmallInteger }" |
 
     stop := self size.
+    aSequenceableCollection size == stop ifFalse:[
+        NotEnoughElementsSignal raiseRequestErrorString:'collections must be of the same size'.
+    ].
     1 to:stop do:[:index |
         aThreeArgBlock 
             value:(self at:index) 
@@ -5912,6 +5914,37 @@
 
     "Created: / 05-07-2006 / 18:07:11 / fm"
     "Modified (comment): / 08-01-2012 / 17:18:59 / cg"
+!
+
+with:collection2 with:collection3 do:aThreeArgBlock
+    "evaluate the argument, aBlock for successive elements from
+     each the receiver and the collection arguments.
+     The last argument, aBlock must be a three-argument block.
+     The collection arguments must implement access via a numeric key 
+     and the sizes must be the same."
+
+    |stop  "{ Class: SmallInteger }" |
+
+    stop := self size.
+    (collection2 size == stop and:[collection3 size == stop])  ifFalse:[
+        NotEnoughElementsSignal raiseRequestErrorString:'collections must be of the same size'.
+    ].
+
+    1 to:stop do:[:index |
+        aThreeArgBlock 
+            value:(self at:index) 
+            value:(collection2 at:index)
+            value:(collection3 at:index).
+    ]
+
+    "
+     #(one two three four five six)
+        with:(1 to:6)
+        with:(100 to:600 by:100)
+        do:[:el1 :el2 :el3 | Transcript show:el1; space; show:el2; space; showCR:el3]
+    "
+
+    "Modified (Format): / 30-06-2011 / 17:39:59 / cg"
 ! !
 
 !SequenceableCollection methodsFor:'filling & replacing'!
@@ -7686,7 +7719,6 @@
     "Created: 14.2.1997 / 16:13:03 / cg"
 ! !
 
-
 !SequenceableCollection methodsFor:'searching'!
 
 detect:aBlock startingAt:startIndex