2017-04-04 18:45 GMT+02:00 Esteban Lorenzano <[email protected]>:

> still is not there, because is not the same primitive :)
> look, this is the way where it is generated:
>
> translatedPrimitives
> "an assorted list of various primitives"
> (ByteString compiledMethodAt: 
> #findSubstringViaPrimitive:in:startingAt:matchTable:
> ifAbsent: []) ifNotNil:
> [^#("Pharo uses findSubstringViaPrimitive:in:startingAt:matchTable:"
> (Bitmap compress:toByteArray:)
> (Bitmap decompress:fromByteArray:at:)
> (Bitmap encodeBytesOf:in:at:)
> (Bitmap encodeInt:in:at:)
> (ByteString compare:with:collated:)
> (ByteString translate:from:to:table:)
> (ByteString findFirstInString:inSet:startingAt:)
> (ByteString indexOfAscii:inString:startingAt:)
> (String findSubstringViaPrimitive:in:startingAt:matchTable:)
> (ByteArray hashBytes:startingWith:)
> (SampledSound convert8bitSignedFrom:to16Bit:))].
> ^#(
> (Bitmap compress:toByteArray:)
> (Bitmap decompress:fromByteArray:at:)
> (Bitmap encodeBytesOf:in:at:)
> (Bitmap encodeInt:in:at:)
> (ByteString compare:with:collated:)
> (ByteString translate:from:to:table:)
> (ByteString findFirstInString:inSet:startingAt:)
> (ByteString indexOfAscii:inString:startingAt:)
> (ByteString findSubstring:in:startingAt:matchTable:)
> (ByteArray hashBytes:startingWith:)
> (SampledSound convert8bitSignedFrom:to16Bit:)
> )
>
> means that Pharo uses #indSubstringViaPrimitive:in:startingAt:matchTable:
> while squeak uses #findSubstring:in:startingAt:matchTable:.
>

Ok maybe I not understand anything :) But to clarify lets look at image
side methods.
in Squeak:

ByteString>>findSubstring: key in: body startingAt: start matchTable:
matchTable
<primitive: 'primitiveFindSubstring' module: 'MiscPrimitivePlugin'>


in Pharo:

String>>findSubstringViaPrimitive: key in: body startingAt: start
matchTable: matchTable
<primitive: 'primitiveFindSubstring' module: 'MiscPrimitivePlugin'>


So to me they both uses same VM primitive primitiveFindSubstring. Does they
are really different inside VM?

Reply via email to