Re: Saving a project in Etoys
Edwin Ancaer <[email protected]>
| Newsgroups | gmane.comp.lang.smalltalk.squeak.general |
|---|---|
| Message-ID | <CAMSnosMg6vgSS_SHTjHVL1dCBX5QbCqmUEx_BNuybiTEgfokdg@mail.gmail.com> |
Christophe, Indeed, it works in the latest version. Thanks, Edwin. *; Op wo 27 mei 2026, 18:42 schreef Thiede, Christoph via Squeak-dev < [email protected]>: > Hi Edwin, > > are you using Squeak 6.0? It seems we already fixed that issue in the > latest version of the Squeak (the trunk): > https://lists.squeakfoundation.org/archives/list/[email protected]/message/L4CQRDRU6TSTSHC3V52BBZ2IYNU6SPSX/ Hm > ... we could backport that fix to 6.0 ... > Anyway, glad you discovered this solution by yourself. :-) > > > Both solutions lead to a next error, but I would like to solve this one > first. > > It sounds as if you already solved the bug correctly yourself. > > > So, could someone tell me if a compiledBlock can have instance variables > or not? > > Instance variable belong to a class, not to a method or block. But yes, > any kind of compiled code objects, i.e. compiled methods and compiled > blocks, can reference instance variables via certain bytecode instructions. > Here is one example of many: > > Bag>>sortedCounts > "Answer with a collection of counts with elements, sorted by decreasing > count." > > ^(Array new: contents size streamContents: [ :stream | > contents associationsDo: [ :each | > stream nextPut: each value -> each key ] ]) > sort: [:x :y | x >= y ]; > yourself > > Here, the compiled block [ :stream | ....] references the instance > variable contents of the receiver. > > (To find all examples of such blocks, you could try this snippet: > (self systemNavigation allMethodsSelect: [:m | true]) gather: [:m | m > compiledMethod codeLiterals select: [:ea | (ea isKindOf: CompiledBlock) > and: [ea hasInstVarRef]]]) > > HTH! If you experience any other issues, please let us know! > > Best, > Christoph > ------------------------------ > *Von:* Edwin Ancaer <[email protected]> > *Gesendet:* Mittwoch, 27. Mai 2026 16:51 Uhr > *An:* The general-purpose Squeak developers list < > [email protected]> > *Betreff:* [squeak-dev] Saving a project in Etoys > > Hello, > > when saving a project in Etoys, I allways get the > error: MessageNotUnderstood: CompiledBlock>>hasInstVarRef. > > And indeed, there is no method hasInstVarRef in the class CompiledBlock. > There is one in CompiledMethod however. This makes me suppose that there > once was a method hasInstVarRef in CompiledBlock, and it has been removed. > > Maybe because a compiledBlock cannot have instance variables? > In that case , can I define a method hasInstVarRef that returns false in > CompiledBlock? > > On the other hand, if I copy the method hasInstVarRef from CompiledMethod > to CompiledBlock, that in itself works also. > > Both solutions lead to a next error, but I would like to solve this one > first. So, could someone tell me if a compiledBlock can have instance > variables or not? > > Kind regards, > > Edwin Ancaer > > > > > *; > Squeak-dev mailing list -- [email protected] > To unsubscribe send an email to > [email protected] Squeak-dev mailing list -- [email protected] To unsubscribe send an email to [email protected]