The Inbox: Kernel-ct.1337.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: Kernel-ct.1337.mcz

commits-2
A new version of Kernel was added to project The Inbox:
http://source.squeak.org/inbox/Kernel-ct.1337.mcz

==================== Summary ====================

Name: Kernel-ct.1337
Author: ct
Time: 20 August 2020, 2:38:04.66564 pm
UUID: f4a90a1e-f869-4b43-b786-d451978cba31
Ancestors: Kernel-dtl.1336

Complements 60Deprecated-ct.80 (deprecation #doWithIndex: & Co.).

=============== Diff against Kernel-dtl.1336 ===============

Item was changed:
  ----- Method: ClassDescription>>forceNewFrom: (in category 'instance variables') -----
  forceNewFrom: anArray
      "Create a new instance of the class and fill
      its instance variables up with the array."
      | object max |
 
      object := self new.
      max := self instSize.
+     anArray withIndexDo: [:each :index |
-     anArray doWithIndex: [:each :index |
          index > max ifFalse:
              [object instVarAt: index put: each]].
      ^ object!

Item was changed:
  ----- Method: Object>>copySameFrom: (in category 'copying') -----
  copySameFrom: otherObject
  "Copy to myself all instance variables named the same in otherObject.
  This ignores otherObject's control over its own inst vars."
 
  | myInstVars otherInstVars |
  myInstVars := self class allInstVarNames.
  otherInstVars := otherObject class allInstVarNames.
+ myInstVars withIndexDo: [:each :index |
- myInstVars doWithIndex: [:each :index |
  | match |
  (match := otherInstVars indexOf: each) > 0 ifTrue:
  [self instVarAt: index put: (otherObject instVarAt: match)]].
  1 to: (self basicSize min: otherObject basicSize) do: [:i |
  self basicAt: i put: (otherObject basicAt: i)].
  !

Item was changed:
  ----- Method: Object>>longPrintOn: (in category 'printing') -----
  longPrintOn: aStream
  "Append to the argument, aStream, the names and values of all
  of the receiver's instance variables."
 
+ self class allInstVarNames withIndexDo:
- self class allInstVarNames doWithIndex:
  [:title :index |
  aStream nextPutAll: title;
  nextPut: $:;
  space;
  tab;
  print: (self instVarAt: index);
  cr]!

Item was changed:
  ----- Method: Object>>longPrintOn:limitedTo:indent: (in category 'printing') -----
  longPrintOn: aStream limitedTo: sizeLimit indent: indent
  "Append to the argument, aStream, the names and values of all of the receiver's instance variables.  Limit is the length limit for each inst var."
 
+ self class allInstVarNames withIndexDo:
- self class allInstVarNames doWithIndex:
  [:title :index |
  indent timesRepeat: [aStream tab].
  aStream nextPutAll: title;
  nextPut: $:;
  space;
  tab;
  nextPutAll:
  ((self instVarAt: index) printStringLimitedTo: (sizeLimit -3 -title size max: 1));
  cr]!