Issue 5564 in pharo: Support bit operations on Boolean / Integers

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

Issue 5564 in pharo: Support bit operations on Boolean / Integers

pharo
Status: Accepted
Owner: ----
Labels: Milestone-1.5 Type-Feature

New issue 5564 by [hidden email]: Support bit operations on Boolean  
/ Integers
http://code.google.com/p/pharo/issues/detail?id=5564

add the following methods
Integer >> |
Integer >> &


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

Re: Issue 5564 in pharo: Support bit operations on Boolean / Integers

pharo
Updates:
        Status: FixToInclude

Comment #1 on issue 5564 by [hidden email]: Support bit operations  
on Boolean / Integers
http://code.google.com/p/pharo/issues/detail?id=5564

(No comment was entered for this change.)

Attachments:
        bitOperations.2.cs  2.4 KB


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

Re: Issue 5564 in pharo: Support bit operations on Boolean / Integers

pharo
Updates:
        Status: FixReviewNeeded

Comment #2 on issue 5564 by [hidden email]: Support bit operations on  
Boolean / Integers
http://code.google.com/p/pharo/issues/detail?id=5564

These operators already have a meaning, please don't overload it.

true & 3 = ?
3 & true = ?


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

Re: Issue 5564 in pharo: Support bit operations on Boolean / Integers

pharo

Comment #3 on issue 5564 by [hidden email]: Support bit operations  
on Boolean / Integers
http://code.google.com/p/pharo/issues/detail?id=5564

we're in a dynamic language... you cannot enforce this.

just check for the implementors of #with: and you will see that in many  
cases they require different types of arguments.

| and & forwarding to bitOr: and bitAnd: is just a nice convenience for  
writing code.


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

Re: Issue 5564 in pharo: Support bit operations on Boolean / Integers

pharo

Comment #4 on issue 5564 by [hidden email]: Support bit operations on  
Boolean / Integers
http://code.google.com/p/pharo/issues/detail?id=5564

Bitwise operations are supposedly symmetric, yes?

Again:
true & 3 -> 3
3 & true -> 1

I'm not saying we should enforce it, I'm saying it's against good taste to  
use a selector which already has a different meaning for a valid argument  
(when you expect symmetry)


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

Re: Issue 5564 in pharo: Support bit operations on Boolean / Integers

pharo

Comment #5 on issue 5564 by [hidden email]: Support bit operations on  
Boolean / Integers
http://code.google.com/p/pharo/issues/detail?id=5564

I read the changeSet wrong I think, my mind thought
bitAnd: aNumber
        ^aNumber bitAnd: self asBit

or similar was included :)

Carry on.


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

Re: Issue 5564 in pharo: Support bit operations on Boolean / Integers

pharo

Comment #6 on issue 5564 by [hidden email]: Support bit operations  
on Boolean / Integers
http://code.google.com/p/pharo/issues/detail?id=5564

ok ;)


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

Re: Issue 5564 in pharo: Support bit operations on Boolean / Integers

pharo
In reply to this post by pharo
Updates:
        Status: FixToInclude

Comment #8 on issue 5564 by [hidden email]: Support bit operations  
on Boolean / Integers
http://code.google.com/p/pharo/issues/detail?id=5564

(No comment was entered for this change.)


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

Re: Issue 5564 in pharo: Support bit operations on Boolean / Integers

pharo
Updates:
        Status: Integrated

Comment #9 on issue 5564 by [hidden email]: Support bit operations  
on Boolean / Integers
http://code.google.com/p/pharo/issues/detail?id=5564

in 2.0 009


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