Try Smalltalk listLoadedModules *after* a call to the plugin. In a workspace: 'foobar' hash <PrintIt> ==> 211347526 Smalltalk listLoadedModules <PrintIt> ==> #('B2DPlugin 32 May 2001 (i)' 'FloatArrayPluging 20 May 2001 (i)' 'Matrix2x3Plugin 30 May 2001 (i)' 'BitBltPlugin 30 May 2001 (i)' 'SecurityPlugin 30 May 2001 (i)' 'LargIntegers v1.2 30 May 2001 (i)' 'FilePlugin 30 May 2001 (i)' 'MiscPrimitivePlugin 30 May 2001 (i)' )
String class>>stringHash:initialHash: starts with
<primitive: 'primitiveStringHash' module: 'MiscPrimitivePlugin'>
so the plugin is there.
> How do I check whether it has this method or not? In the method calling the prim you could place a self error: 'not called' after the prim call. If the prim call works (since the plugin is reachable), the error line won't be reached. Adding 'self halt.' after the <primitive: > line and typing Cmd-s results in an unresponsive Squeak. Thank goodness File|Quit works.
Adding 'Transcript print: stringSize; endEntry.' after the assignment to stringSize results in a never-ending series of 9s appearing on the Transcript.
So the module IS loaded but the primitive is NOT being used.
I note that MiscPrimitivePlugin is dated 2001.05.30, but the String class>>stringHash:initialHash: method is dated 2001.09.28.
It looks like the Squeak 3.2 I downloaded from the usual site didn't have an up to date MiscPrimitivePlugin.
Someone else will have to fix this; I don't understand plugins at all.
Some strange and some not strange things here...
Richard A. O'Keefe wrote:
Try Smalltalk listLoadedModules *after* a call to the plugin.
In a workspace: 'foobar' hash <PrintIt> ==> 211347526 Smalltalk listLoadedModules <PrintIt> ==> #('B2DPlugin 32 May 2001 (i)'
Strange: 32 May?
'FloatArrayPluging 20 May 2001 (i)' 'Matrix2x3Plugin 30 May 2001 (i)' 'BitBltPlugin 30 May 2001 (i)' 'SecurityPlugin 30 May 2001 (i)' 'LargIntegers v1.2 30 May 2001 (i)' 'FilePlugin 30 May 2001 (i)' 'MiscPrimitivePlugin 30 May 2001 (i)' )
String class>>stringHash:initialHash: starts with
<primitive: 'primitiveStringHash' module: 'MiscPrimitivePlugin'>
so the plugin is there.
How do I check whether it has this method or not?
In the method calling the prim you could place a self error: 'not called' after the prim call. If the prim call works (since the plugin is reachable), the error line won't be reached.
Adding 'self halt.' after the <primitive: > line and typing Cmd-s results in an unresponsive Squeak. Thank goodness File|Quit works.
Not strange: Oh, it'd have been better to say, 'Try this with a copy of the hash method!': if you change it *there* all string hashes are not working anymore, so the result doesn't surprise me.
Adding 'Transcript print: stringSize; endEntry.' after the assignment to stringSize results in a never-ending series of 9s appearing on the Transcript.
Dito.
So the module IS loaded but the primitive is NOT being used.
Very strange. On which platform do you work?
The next question would be (after knowing the platform): Could anybody with the same VM prove the result? If this should be a common problem with the official distribution, many people should have some performance drawbacks...
I note that MiscPrimitivePlugin is dated 2001.05.30, but the String class>>stringHash:initialHash: method is dated 2001.09.28.
Does anybody know, what has changed there?
It looks like the Squeak 3.2 I downloaded from the usual site didn't have an up to date MiscPrimitivePlugin.
Seems to be the logical consequence, but is strange.
Someone else will have to fix this; I don't understand plugins at all.
Don't worry.
Greetings,
Stephan
squeak-dev@lists.squeakfoundation.org