Login  Register

Primitive is not executed

Posted by Jesús Marí on Jun 09, 2020; 1:30pm
URL: https://forum.world.st/Primitive-is-not-executed-tp5118091.html

I am developing a "numpy arrays" like  framework on pharo, I decided to use an Array type depending on the class of its elements (I thought it would be more efficient) i.e if the array contains floats it will be stored in a floatArray but if contains integers, a IntegerArray will be used.
I make an extensive use of use of the method replaceFrom: start to: stop with: replacement startingAt: repStart when I do concat and other methods that imply copying but I've realize that primitive 105 is not executes when I call this method from these kind of arrays but it works if I use a normal Array.
What do you suggest me to do? is it better to use the normal Array for every type of content or is it a bugg? Is FloatArray/IntegerArray more efficient in any way? If not...what is their purpose?


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."
<primitive: 105>
super replaceFrom: start to: stop with: replacement startingAt: repStart