The Trunk: Kernel-ul.1024.mcz

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

The Trunk: Kernel-ul.1024.mcz

commits-2
Levente Uzonyi uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ul.1024.mcz

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

Name: Kernel-ul.1024
Author: ul
Time: 20 May 2016, 1:19:14.472859 am
UUID: 68c736cc-d98c-4303-a68e-312488b5c51a
Ancestors: Kernel-eem.1023

Copied the fallback code of LargePositiveInteger >> #replaceFrom:to:with:startingAt: from its parent class and extended it to make it compatible with the primitive as well.

=============== Diff against Kernel-eem.1023 ===============

Item was changed:
  ----- Method: LargePositiveInteger>>replaceFrom:to:with:startingAt: (in category 'system primitives') -----
  replaceFrom: start to: stop with: replacement startingAt: repStart
  "Primitive. This destructively replaces elements from start to stop in the receiver starting at index, repStart, in the collection, replacement. Answer the receiver. Range checks are performed in the primitive only. Optional. See Object documentation whatIsAPrimitive."
+
+ | index replacementIndex |
  <primitive: 105>
+ replacementIndex := repStart.
+ index := start.
+ replacement isInteger ifTrue: [
+ "This branch is only here to accept SmallInteger replacements not handled by the primitive."
+ [ index <= stop ] whileTrue: [
+ self digitAt: index put: (replacement digitAt: replacementIndex).
+ index := index + 1.
+ replacementIndex := replacementIndex + 1 ].
+ ^self ].
+ "Primitive compatible variant which doesn't support SmallInteger replacements."
+ [ index <= stop ] whileTrue: [
+ self basicAt: index put: (replacement basicAt: replacementIndex).
+ index := index + 1.
+ replacementIndex := replacementIndex + 1 ]!
- ^ super replaceFrom: start to: stop with: replacement startingAt: repStart!