[Cuis-dev] unnecessary punctuation

Vanessa Freudenberg vanessa at codefrau.net
Thu Jun 13 13:13:17 PDT 2024


On Thu, Jun 13, 2024 at 12:38 PM Ezequiel Birman via Cuis-dev <
cuis-dev at lists.cuis.st> wrote:

> Wouldn't the same concern exist for blocks?
>
> It is *expected* of blocks to understand *#value*. There is no concern;
> if you redefine *BlockClosure >> value*, the image will crash.
>

Right. Also, look at all the implementors of #value. None of the ~30
classes only return self.

That means if you write

    x := cond ifTrue: a ifFalse: b.

and you expect x to be either a or b, you might be in for a surprise if you
happen to pass in a or b that implements value.

Whereas with

    x := cond ifTrue: [a] ifFalse: [b].

you do get a or b.

– Nessa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240613/8cd64508/attachment.htm>


More information about the Cuis-dev mailing list