[squeak-dev] Integer>>#|

Marcel Taeumel marcel.taeumel at hpi.de
Sat May 23 15:37:36 UTC 2020


Yes, the bit-wise operators from C translate to #bit*: messages in Smalltalk.

However, ages ago, someone started to support #>> and #<< on Integer for bit shifting. So, it is somewhat inconsistent.

Even though there are & and | in Boolean, most of the time, the code reads better with #and: or #or:. It can be challenging already to teach students the difference between "expOne or: [expTwo]" and "expOne or: (expTwo)". Adding & and | to the mix is not helpful. :-D

Next step would be to support #ifTrue:ifFalse: on Integer? Please, don't. :-)

Best,
Marcel
Am 23.05.2020 14:12:47 schrieb K K Subbu <kksubbu.ml at gmail.com>:
On 23/05/20 3:18 pm, Edgar De Cleene wrote:
> Seems
> Integer>>#|
>
> Is not in Squeak 6.0 .
> Any reason ?
AFAIK, #| has always been boolean or operator in Smalltalk. The bitwise
or is #bitOr: as in:

2r1011 bitOr: 2r101 "15"

HTH .. Subbu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200523/09ddf20b/attachment.html>


More information about the Squeak-dev mailing list