[squeak-dev] Object >> #cull:

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Mon Dec 9 17:51:23 UTC 2019


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:

[cid:95ff5c48-deea-4916-916d-937c0382e78b]


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/20191209/fce0fb0f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedImage.png
Type: image/png
Size: 7123 bytes
Desc: pastedImage.png
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20191209/fce0fb0f/attachment.png>


More information about the Squeak-dev mailing list