I couldn't agree more! However, here the problem is not that the format isn't a correct format. The problem is that a bytecode is activated that is incompatible with the instance format. So basically on every bytecode accessing an instance you would have to check if this is a valid access. And as we all know, Smalltalk avoids this; it makes things faster :) Toon On 03/21/2011 12:49 PM, Igor Stasenko wrote:
On 21 March 2011 11:29, Tudor Girba<tudor.girba@gmail.com> wrote:
Thanks, Toon!
I changed the code to explicitly set the format, and it seems to fix the problem:
cls := Class new superclass: MooseElement; setFormat: MooseElement format; yourself. cls compileSilently: 'mooseName ^ 1/0'. element := cls new.
Is this correct?
Yes, you should pay attention to have correct format. But of course VM could also be more cautios and verify if your class are well formed before creating an instance of it..
Cheers, Doru