On Sun, Nov 27, 2011 at 6:07 PM, St�phane Ducasse <stephane.ducasse@inria.fr> wrote:
It crashed my NBCog and Cog one vm. so I should probably upgrade.


Yes, there were some bugs related to #cannotInterpret:� a while ago with Cog. It should not crash with newest Cog versions. Please tell me if it happens.

Stef



On Nov 27, 2011, at 11:36 AM, St�phane Ducasse wrote:

> thanks noury!
>
>
> Stef
>
> On Nov 26, 2011, at 9:05 PM, Noury Bouraqadi wrote:
>
>> Stef,
>>
>> You can easily obtain the list by using a Ghost proxy.
>> 1) Install the package :
>> � � �Gofer new
>> � � �squeaksource: 'Marea';
>> � � �package: 'GhostProxies';
>> � � �package: 'GhostProxiesTests';
>> � � �load.
>>
>> 2) uncomment the body of method �SimpleForwarderHandler>>log: aString
>> � � �Transcript show: aString; cr.
>>
>> 3) open a transcript
>>
>> 4) create a proxy on any object and play with it
>> � � �(ObjectProxy proxyFor: (Object new)) inspect
>>
>> 5) analyze the log on the transcript :-)
>>
>>
>> On 25 nov. 2011, at 22:19, St�phane Ducasse wrote:
>>
>>>
>>> On Nov 25, 2011, at 10:09 PM, Toon Verwaest wrote:
>>>
>>>> Ok, I guess I was confused by your initial question: "the methods that I should define in a subclass of ProtoObject so that I can use basicNew"... :)
>>>
>>> :)
>>>
>>> Yes it is more the methods that I should define to have a usable class (browse, doit, inspect it). I will probably have to do it by try and error.
>>>
>>> Stef
>>>
>>>>
>>>> On 11/25/2011 10:05 PM, St�phane Ducasse wrote:
>>>>> I'm confused.
>>>>> I'm not creating a class but an instance.
>>>>> if it would be Behavior basicNew then yes I made sure that we could do Behavior new and not crashing the system back in Squeak.
>>>>>
>>>>> On Nov 25, 2011, at 9:45 PM, Toon Verwaest wrote:
>>>>>
>>>>>> With the magic number I mean the number that defines the object's structure. It's one of the first 3 instance variables of every class, encoding how many instance variables there are; what kind of object it is supposed to be (normal, array, bytes, words...). Every "class" basically needs 3 instance variables. 1 defines the structure, 1 the superclass, 1 the behavior (method dictionary). I don't know the other; but just look at some class to know what the order is.
>>>>> Yes format, methodDict, superclass (probably in a different order).
>>>>> And format is ugly because not explicit and coded in several place like instSpec (berk)
>>>>>
>>>>>> And yes, if you want to inspect the object, you'll need to support whatever protocol your inspector is using.
>>>>>>
>>>>>> The format is formed as follows:
>>>>>>
>>>>>> format
>>>>>> �| fieldSize sizeHiBits format |
>>>>>> �fieldSize := self fieldSize + 1.
>>>>>> �sizeHiBits := fieldSize // 64.
>>>>>> �format := sizeHiBits.
>>>>>> �format := (format bitShift: 5) + compactClassIndex.
>>>>>> �format := (format bitShift: 4) + self instanceSpecification.
>>>>>> �format := (format bitShift: 6) + (fieldSize \\ 64).
>>>>>> �format := (format bitShift: 1).
>>>>>> �^ format
>>>>>>
>>>>>> If I read it correctly (just glancing), instance specification specifies if it's arrayed and if it has fields. 0 -> �no fields, not arrayed, 1 -> �fields, not arrayed, 2 -> �arrayed no fields, 3 -> �arrayed fields.
>>>>>>
>>>>>>
>>>>>> HTH,
>>>>>> Toon
>>>>>>
>>>>>> On 11/25/2011 09:31 PM, St�phane Ducasse wrote:
>>>>>>> Apparently I can do a doit I was naively doing an inspect ;)
>>>>>>>
>>>>>>>
>>>>>>>> Don't you just need the basicNew primitive, and make sure that the "magic number" is set in the object that has the basicNew installed to something that makes sense?
>>>>>>>>
>>>>>>> I do not know what is the magic number.
>>>>>>> I guess that my problem was that I have first to define what is the minimal behavior.
>>>>>>>
>>>>>>>
>>>>>>>> If you want to send messages to the object, probably also best install some dictionary as the method dict instvar.
>>>>>>>>
>>>>>>> But I guess that ProtoObject has some behavior since I can browse the class with a browser.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> Toon
>>>>>>>>
>>>>>>>> On 11/25/2011 09:26 PM, St�phane Ducasse wrote:
>>>>>>>>
>>>>>>>>> Hi
>>>>>>>>> I would like to know the methods that I should define in a subclass of ProtoObject so that I can use basicNew.
>>>>>>>>> Does any of you have an idea?
>>>>>>>>>
>>>>>>>>> Stef
>>>>>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>> Noury
>> --
>> http://twitter.com/#!/NouryBouraqadi
>>
>>
>>
>>
>>
>
>





--
Mariano
http://marianopeck.wordpress.com