[squeak-dev] Object >> #cull:

Marcel Taeumel marcel.taeumel at hpi.de
Tue Dec 10 08:38:56 UTC 2019


Hi Christoph,

let's discuss that after the 5.3 release.

> such as blocks or MessageSends 

Well, then BlockClosure and MessageSend would be the place to add #cull:. There is no need to put it in Object because any class can choose to freely and dynamically participate in such a protocol. :-)

Best,
Marcel
Am 09.12.2019 18:51:35 schrieb Thiede, Christoph <christoph.thiede at student.hpi.uni-potsdam.de>:
Hi all!

Just another, possibly crazy idea: What about implementing #cull:, #cull:cull: etc. on Object?

Object >> #cull: firstArg
    ^ self value

This could improve the polymorphy between "evaluables" such as blocks or MessageSends and other objects. Example:

[2 / 0] on: ZeroDivide do: Float infinity


Some current implementations that call both #isBlock and #cull: also reveal that there might be a small break in the interface. From #haltIf:


Just wanted to share that thought :) In general, do you think blurring the differences between block and object in that way might be a good idea or rather a bad one? At least we already have implemented #value on Object.

Disclaimer: I know that in many cases, you should prefer a block for performance reasons/compiler optimization, but there is still a gap between the interfaces ...

Best,
Christoph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20191210/0337cd64/attachment.html>


More information about the Squeak-dev mailing list