Problems using #tallyMethods:

Alejandro F. Reimondo aleReimondo at sugarweb.com
Sat Sep 26 16:01:49 UTC 1998


Folks,

The simulator detects primitive failures (during simulation)
  when it returns #simulatorFail and halts the simulation
  with the title 'Code simulation error'.
The problem with this technique is that we cant simulate
  primitive expressions returning the symbol #simulatorFail
  for example :

ContextPart tallyMethods: [ #(1 2 #simulatorFail 4) at: 3 ]

We can think that expressions like this are not used too much...
But if you try to simulate code that sends the message #asSymbol
  to a string (begining with $s) the simbol table (array) will be
  traversed (sending #at:) and simulator fails!

ContextPart tallyMethods: [ 'some' asSymbol ]

I need to tally the methods of a (long) expression that sends
  #asSymbol many times, but when sending to strings starting with $s
  (and greater than 'simulatorFail') the simulator halts.
If I open the debugger and try to restart the primitive method
  the SqueakVM crashes(jitter) or another walback is obtained. :-(

How can I solve the problem?
I have implemented a dirty hacking like....

Symbol hack: #simulatorFail with: #simulatorFait doing: [
	ContextPart tallyMethods: [ 'some' asSymbol ]
]

Provably a better solution exists.
Ale.

Content-Type: application/octet-stream; name="Symbol class-hacking.st"

Attachment converted: Anon:Symbol class-hacking.st (????/----) (0000333C)





More information about the Squeak-dev mailing list