[squeak-dev] Re: I really miss a binary bitOr: selector for integers

Andreas Raab andreas.raab at gmx.de
Tue May 18 05:41:31 UTC 2010


On 5/17/2010 6:26 PM, Igor Stasenko wrote:
> Hello,
> C world using bitor-s extensively for passing various flags and options.
>
> And porting the code looks really awful with #bitOr: , because it
> requires braces when you combining more than 2 flags.
>
> Can we , please , please, include #| as an alternative selector for
> bitor-ing integers into a kernel?

+1. But then we also need #& and something like #not. So that I can 
simply write:

setFlag: aBool

   flags := aBool ifTrue:[flags | FlagConstant] ifFalse:[flags & 
FlagConstant not].

> Btw, Alien alredy adds it as extension. But i would really like to get
> it into the core, so any other may use it.
>
> Meanwhile, i defined own awfull extension selector -  #++

Eeeeeek! :-)

Cheers,
   - Andreas



More information about the Squeak-dev mailing list