[Etoys] How to distribute amd install MO for Apps

Karl karl.ramberg at comhem.se
Sun Nov 25 11:39:15 EST 2007


Yoshiki Ohshima wrote:
>> I tested using CodeLoader with DrGeo but it seems load times are about 
>> the same as with the regular project saving with less control over 
>> included changes :-(
>>
>> CodeLoader exportCodeSegment: 'tester.extSeg' classes: ChangeSet current 
>> changedClasses keepSource: false
>>     
>
>   CodeLoader still uses textual code and you need to parse it upon
> loading, right?
There is a method in ImageSegment that looks promising:

ImageSegment>>scanFrom: aStream
    "Move source code from a fileIn to the changes file for classes in 
an ImageSegment.  Do not compile the methods.  They already came in via 
the image segment.  After the ImageSegment in the file, !ImageSegment 
new! captures control, and scanFrom: is called."
        | val chunk |

    [aStream atEnd] whileFalse:
        [aStream skipSeparators.
        val _ (aStream peekFor: $!)
            ifTrue: ["Move (aStream nextChunk), find the method or class
                        comment, and install the file location bytes"
                    (Compiler evaluate: aStream nextChunk logged: false)
                        scanFromNoCompile: aStream forSegment: self]
            ifFalse: [chunk _ aStream nextChunk.
                    aStream checkForPreamble: chunk.
                    Compiler evaluate: chunk logged: true].
        aStream skipStyleChunk].
    "regular fileIn will close the file"
    ^ val

I'm not sure the method is actually called from anywhere. I put in a 
'self halt' but no luck...
Anyway the method seems to hint at a way to get the outpointers in to 
the image with no recompilation.

Karl


More information about the Etoys mailing list