[squeak-dev] Questions about FullBlock closures
Thiede, Christoph
Christoph.Thiede at student.hpi.uni-potsdam.de
Sat Feb 11 15:22:47 UTC 2023
Hi Jaromir,
great questions, looking forward to a comprehensive answer, too. :-)
Ad 1: I suppose these instances were created prior to the introduction of FullBlockClosure and the SistaV1 bytecode set. It's funny to see they're still alive and appear to work.
Best,
Christoph
________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Jaromir Matas <mail at jaromir.net>
Gesendet: Samstag, 11. Februar 2023 14:08:52
An: Squeak Dev
Betreff: [squeak-dev] Questions about FullBlock closures
Hi,
Two questions:
1) When I do:
BlockClosure allInstances size "---> 66"
I always get 66 instances of BlockClosure, all of them probably related to the UI (as far as I can tell).
Q: Why do we have those closures as instances of BlockClosure and not FullBlockClosure? (just trying to understand)
2) When I do:
(FullBlockClosure allInstances select: [:each | each outerContext isNil]) size "---> 0"
I always get zero; this means there are no closures without the outer context set. However, the class comment says:
FullBlockClosure: [...] outerContext can be either a Context or nil.
Q: When would it make sense to use a FullBlockClosure with nilled outer context? No such situation in the system?
I wonder: if we used a FullBlockClosure with outerContext == nil, how would then methods like Context >> home work? They assume 'closureOrNil outerContext' is not nil and would fail, if I understand correctly. Am I missing something/confused??
Many thanks for any help,
best,
Jaromir
--
JaromÃr Matas
mail at jaromir.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20230211/69fa190c/attachment.html>
More information about the Squeak-dev
mailing list
|