Login  Register

Re: Primitive is not executed

Posted by Stéphane Ducasse on Jun 09, 2020; 4:33pm
URL: https://forum.world.st/Primitive-is-not-executed-tp5118091p5118110.html

Hello

I am developing a "numpy arrays" like  framework on pharo,

Cool 

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.

Did you check the WordArray class and friend?


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?

I read the code and I do not understand why this primitives have all the same number. 
May be this is normal. I will ask around. 


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

S.
--------------------------------------------
Stéphane Ducasse
03 59 35 87 52
Assistant: Aurore Dalle 
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley, 
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France