#359 Add numeric logical methods to string class

None
open
nobody
None
5
2012-08-22
2009-06-21
Rick McGuire
No

When implementing some standards into ooRexx, you frequently run into a paradigm where options are specified using constants that are bit flag positions within a number. It would be nice to have some methods that enable this sort of bit flag testing using numeric values. At a minimum, the following methods would be required:

1) Test bit positions with a mask (an AND operation from a binary standpoint)
2) Set bit positions using a mask (an OR operation from a binary standpoint)
3) Clear bit positions using a mask (an AND with complement operation)

Discussion

  • Jon Wolfers
    Jon Wolfers
    2009-09-06

    Good Idea. This would enhance readability - I know I always take a deep breath when faced with something like

    return (bitAnd(arg(1),arg(2)) == arg(2))

    Jon

     


Anonymous


Cancel   Add attachments