Hi Ken,<br><br><div class="gmail_quote">On Thu, Jul 16, 2009 at 1:58 PM, Ken Causey <span dir="ltr">&lt;<a href="mailto:ken@kencausey.com">ken@kencausey.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
What &#39;3.9 final image&#39; are you referring to?  I see none of these<br>
methods in 3.9-7067.  Why are we talking about 3.9 anyway?</blockquote><div><br></div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><div>You reported a failure in trying to load the closure configuration in an image that was equipped with traits, specifically an MNU for variablesAndOffsetsDo:.   I took the nearest traits-equipped image I have to hand, which is Squeak3.9-final-7067.image and looked.  I was then able to explain that this method and a couple of others could be copied from Behavior &amp; ClassDescription into TraitBehavior and TraitDescription to fix the problem.</div>
<div><br></div><div>Does that help?</div><div><br></div><div>best</div></span><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">Eliot</span></div><div>
<span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "></span> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
<font color="#888888"><br>
Ken<br>
</font><div><div></div><div class="h5"><br>
On Thu, 2009-07-16 at 12:31 -0700, Eliot Miranda wrote:<br>
&gt; So someone needs to implement variablesAndOffsetsDo: for TraitBehavior<br>
&gt; analogous to Behavior&gt;&gt; variablesAndOffsetsDo:.<br>
&gt; variablesAndOffsetsDo: is the interface I added between the compiler<br>
&gt; and the class its compiling in to abstract away from instance<br>
&gt; variable/slot implementation.  See Encoder&gt;&gt;init:context:notifying:<br>
&gt; ...<br>
&gt; class variablesAndOffsetsDo:<br>
&gt; [:variable &quot;&lt;String|CFieldDefinition&gt;&quot; :offset &quot;&lt;Integer|nil&gt;&quot; |<br>
&gt; offset isNil<br>
&gt; ifTrue: [scopeTable at: variable name put: (FieldNode new<br>
&gt; fieldDefinition: variable)]<br>
&gt; ifFalse: [scopeTable<br>
&gt; at: variable<br>
&gt; put: (offset &gt;= 0<br>
&gt; ifTrue: [InstanceVariableNode new<br>
&gt; name: variable index: offset]<br>
&gt; ifFalse: [MaybeContextInstanceVariableNode new<br>
&gt; name: variable index: offset negated])]].<br>
&gt; ...<br>
&gt;<br>
&gt;<br>
&gt; FieldNode is the Tweak compiler extension that compiles Tweak property<br>
&gt; access as message sends to slot accessors.  The negative offset hack<br>
&gt; allows ContextPart (actually InstructionStream and subclasses) to<br>
&gt; access its instance variables specially, allowing the VM to hide<br>
&gt; context-to-sack mapping and make contexts appear like normal objects<br>
&gt; even though inside the VM they may actually be proxies for stack<br>
&gt; frames.<br>
&gt;<br>
&gt;<br>
&gt; Quickly looking at the 3.9 final image I&#39;d say that you&#39;d do the<br>
&gt; following copies:<br>
&gt; Behavior variablesAndOffsetsDo: =&gt; TraitBehavior<br>
&gt; Behavior instVarNamesAndOffsetsDo: -&gt; TraitBehavior<br>
&gt; ClassDescription instVarNamesAndOffsetsDo: -&gt; TraitDescription<br>
&gt;<br>
&gt;<br>
&gt; and then things have a good chance of working.<br>
&gt;<br>
&gt;<br>
&gt; HTH<br>
&gt; Eliot<br>
&gt;<br>
&gt; On Thu, Jul 16, 2009 at 10:47 AM, Ken Causey &lt;<a href="mailto:ken@kencausey.com">ken@kencausey.com</a>&gt;<br>
&gt; wrote:<br>
&gt;         So I decided I would try to run all the tests and almost<br>
&gt;         immediately I<br>
&gt;         got a debugger.  This is with an image built using the<br>
&gt;         directions<br>
&gt;         running on 32-bit linux with exupery 0.15.1 VM.  The failure<br>
&gt;         seems to be<br>
&gt;         in the setup of TraitsResource<br>
&gt;<br>
&gt;         Ken<br>
&gt;<br>
&gt;         SecurityManager state:<br>
&gt;         Restricted: false<br>
&gt;         FileAccess: true<br>
&gt;         SocketAccess: true<br>
&gt;         Working Dir /home/ken/projects/squeak/ncdm<br>
&gt;         Trusted Dir /home/ken/projects/squeak/ncdm/secure<br>
&gt;         Untrusted Dir /home/ken/projects/squeak/ncdm/My Squeak<br>
&gt;<br>
&gt;         ClassTrait(Object)&gt;&gt;doesNotUnderstand: #variablesAndOffsetsDo:<br>
&gt;                Receiver: T2 classTrait<br>
&gt;                Arguments and temporary variables:<br>
&gt;                        aMessage:       variablesAndOffsetsDo:<br>
&gt;         [closure] in<br>
&gt;         EncoderForV3PlusClosures(Encoder)...etc...<br>
&gt;                Receiver&#39;s instance variables:<br>
&gt;                        methodDict:     a MethodDictionary()<br>
&gt;                        traitComposition:       {}<br>
&gt;                        localSelectors:         nil<br>
&gt;                        users:  an IdentitySet()<br>
&gt;                        organization:   nil<br>
&gt;                        baseTrait:      T2<br>
&gt;<br>
&gt;         EncoderForV3PlusClosures(Encoder)&gt;&gt;init:context:notifying:<br>
&gt;                Receiver: {an EncoderForV3PlusClosures}<br>
&gt;                Arguments and temporary variables:<br>
&gt;                        aClass:         T2 classTrait<br>
&gt;                        aContext:       nil<br>
&gt;                        req:    a Parser<br>
&gt;                        homeNode:       nil<br>
&gt;                Receiver&#39;s instance variables:<br>
&gt;                        comment:        nil<br>
&gt;                        pc:     nil<br>
&gt;                        scopeTable:     a Dictionary(&#39;false&#39;-&gt;{false}<br>
&gt;         &#39;nil&#39;-&gt;{nil} &#39;self&#39;-&gt;{self}<br>
&gt;         &#39;super&#39;-&gt;...etc...<br>
&gt;                        nTemps:         0<br>
&gt;                        supered:        false<br>
&gt;                        requestor:      a Parser<br>
&gt;                        class:  T2 classTrait<br>
&gt;                        selector:       nil<br>
&gt;                        literalStream:  a WriteStream #()<br>
&gt;                        selectorSet:    a Dictionary(#*-&gt;{*} #+-&gt;{+}<br>
&gt;         #--&gt;{-} #/-&gt;{/} #&#39;//&#39;-&gt;{//}<br>
&gt;         #&lt;-&gt;{&lt;} #...etc...<br>
&gt;                        litIndSet:      a Dictionary()<br>
&gt;                        litSet:         a LiteralDictionary(-1-&gt;{-1}<br>
&gt;         0-&gt;{0} 1-&gt;{1} 2-&gt;{2} )<br>
&gt;                        sourceRanges:   nil<br>
&gt;                        globalSourceRanges:     nil<br>
&gt;                        stream:         nil<br>
&gt;                        position:       nil<br>
&gt;                        rootNode:       nil<br>
&gt;                        blockExtentsToLocals:   nil<br>
&gt;<br>
&gt;         [] in<br>
&gt;         Parser&gt;&gt;parse:class:category:noPattern:context:notifying:ifFail:<br>
&gt;                Receiver: a Parser<br>
&gt;                Arguments and temporary variables:<br>
&gt;         &lt;&lt;error during printing&gt;<br>
&gt;                Receiver&#39;s instance variables:<br>
&gt;                        source:         a ReadStream &#39;m2ClassSide: a<br>
&gt;         ^a&#39;<br>
&gt;                        mark:   14<br>
&gt;                        hereChar:       Character space<br>
&gt;                        aheadChar:      $^<br>
&gt;                        token:  &#39;a&#39;<br>
&gt;                        tokenType:      #word<br>
&gt;                        currentComment:         nil<br>
&gt;                        buffer:         a WriteStream &#39;a&#39;<br>
&gt;                        typeTable:      #(#xBinary #xBinary #xBinary<br>
&gt;         #xBinary #xBinary #xBinary<br>
&gt;         #xBinary #xB...etc...<br>
&gt;                        here:   &#39;m2ClassSide:&#39;<br>
&gt;                        hereType:       #keyword<br>
&gt;                        hereMark:       1<br>
&gt;                        hereEnd:        12<br>
&gt;                        prevMark:       1<br>
&gt;                        prevEnd:        nil<br>
&gt;                        encoder:        {an EncoderForV3PlusClosures}<br>
&gt;                        requestor:      nil<br>
&gt;                        parseNode:      nil<br>
&gt;                        failBlock:      [closure] in<br>
&gt;         Compiler&gt;&gt;translate:noPattern:ifFail:<br>
&gt;                        requestorOffset:        0<br>
&gt;                        tempsMark:      nil<br>
&gt;                        doitFlag:       false<br>
&gt;                        properties:     nil<br>
&gt;                        category:       #&#39;as yet unclassified&#39;<br>
&gt;<br>
&gt;         BlockClosure&gt;&gt;on:do:<br>
&gt;                Receiver: [closure] in<br>
&gt;         Parser&gt;&gt;parse:class:category:noPattern:context:notifying:ifFail:<br>
&gt;                Arguments and temporary variables:<br>
&gt;                        exception:      ReparseAfterSourceEditing<br>
&gt;                        handlerAction:  [closure] in<br>
&gt;         Parser&gt;&gt;parse:class:category:noPattern:context:noti...etc...<br>
&gt;                        handlerActive:  true<br>
&gt;                Receiver&#39;s instance variables:<br>
&gt;                        outerContext:<br>
&gt;         Parser&gt;&gt;parse:class:category:noPattern:context:notifying:ifFail:<br>
&gt;                        startpc:        131<br>
&gt;                        numArgs:        0<br>
&gt;<br>
&gt;<br>
&gt;         --- The full stack ---<br>
&gt;         ClassTrait(Object)&gt;&gt;doesNotUnderstand: #variablesAndOffsetsDo:<br>
&gt;         EncoderForV3PlusClosures(Encoder)&gt;&gt;init:context:notifying:<br>
&gt;         [] in<br>
&gt;         Parser&gt;&gt;parse:class:category:noPattern:context:notifying:ifFail:<br>
&gt;         BlockClosure&gt;&gt;on:do:<br>
&gt;          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br>
&gt;         - -<br>
&gt;         Parser&gt;&gt;parse:class:category:noPattern:context:notifying:ifFail:<br>
&gt;         Compiler&gt;&gt;translate:noPattern:ifFail:<br>
&gt;         Compiler&gt;&gt;compile:in:classified:notifying:ifFail:<br>
&gt;         ClassTrait(TraitBehavior)&gt;&gt;compile:classified:notifying:trailer:ifFail:<br>
&gt;         ClassTrait(TraitDescription)&gt;&gt;compile:classified:withStamp:notifying:logSource:<br>
&gt;         ClassTrait&gt;&gt;compile:classified:withStamp:notifying:logSource:<br>
&gt;         ClassTrait(TraitDescription)&gt;&gt;compile:classified:withStamp:notifying:<br>
&gt;         ClassTrait(TraitDescription)&gt;&gt;compile:classified:notifying:<br>
&gt;         ClassTrait(TraitDescription)&gt;&gt;compile:notifying:<br>
&gt;         ClassTrait(TraitBehavior)&gt;&gt;compile:<br>
&gt;         [] in TraitsResource&gt;&gt;setUp<br>
&gt;         [] in SystemChangeNotifier&gt;&gt;doSilently:<br>
&gt;         BlockClosure&gt;&gt;ensure:<br>
&gt;         SystemChangeNotifier&gt;&gt;doSilently:<br>
&gt;         TraitsResource&gt;&gt;setUp<br>
&gt;         TraitsResource(TestResource)&gt;&gt;initialize<br>
&gt;         TraitsResource class(Behavior)&gt;&gt;new<br>
&gt;         TraitsResource class(TestResource class)&gt;&gt;current<br>
&gt;         TraitsResource class(TestResource class)&gt;&gt;isAvailable<br>
&gt;         [] in TestRunner&gt;&gt;basicSetUpSuite:<br>
&gt;         Set&gt;&gt;do:<br>
&gt;         TestRunner&gt;&gt;basicSetUpSuite:<br>
&gt;         TestRunner&gt;&gt;basicRunSuite:do:<br>
&gt;         TestRunner&gt;&gt;runSuite:<br>
&gt;         TestRunner&gt;&gt;runAll<br>
&gt;         PluggableButtonMorphPlus(PluggableButtonMorph)&gt;&gt;performAction<br>
&gt;         PluggableButtonMorphPlus&gt;&gt;performAction<br>
&gt;         [] in PluggableButtonMorphPlus(PluggableButtonMorph)&gt;&gt;mouseUp:<br>
&gt;         ...etc...<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br>