I really miss a binary bitOr: selector for integers

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

I really miss a binary bitOr: selector for integers

Igor Stasenko
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?

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 -  #++


--
Best regards,
Igor Stasenko AKA sig.

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: I really miss a binary bitOr: selector for integers

Andreas.Raab
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

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project