[squeak-dev] Question about #caseOf:otherwise:

Marcel Taeumel marcel.taeumel at hpi.de
Thu Aug 15 08:32:07 UTC 2019


Hi all!

Why isn't the following example possible?

aNumber caseOf: {
   [:n | n even] -> ['That is an even number.'].
   [:n | n odd] -> ['That is an odd number.'].
}.

That is, why is the check "assoc key value = self" not configurable as "(x := assoc key cull: self) == true or: [x = self]"? :-)

... maybe it is a good thing that case-of statements in Smalltalk are not that powerful?

Best,
Marcel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20190815/98227b69/attachment.html>


More information about the Squeak-dev mailing list