[squeak-dev] Questions about FullBlock closures

Jaromir Matas mail at jaromir.net
Sat Feb 11 13:08:52 UTC 2023


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/b3f3dd1d/attachment.html>


More information about the Squeak-dev mailing list