[squeak-dev] Integer>>#|
Edgar De Cleene
edgardec2005 at gmail.com
Sat May 23 19:50:01 UTC 2020
Of course you right
But Pharo have this
Sent from my iPhone
> On 23 May 2020, at 12:37, Marcel Taeumel <marcel.taeumel at hpi.de> wrote:
>
>
> 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/b45de574/attachment.html>
More information about the Squeak-dev
mailing list
|