First: what Damian said.

Second: Whatever syntax people come up with has to make it easy and
type-safe to name particular combinations of those bits.

In other words, you should be able to make a bitset with Unix-style
permissions:

    OTHER_EXECUTE
    OTHER_WRITE
    OTHER_READ
    GROUP_EXECUTE
    GROUP_WRITE
    GROUP_READ
    ...

But still be able to make bitmasks (ignore the syntax here):

    OTHER_MASK = OTHER_READ +| OTHER_WRITE +| OTHER_EXECUTE;
    GROUP_MASK = GROUP_READ +| GROUP_WRITE +| GROUP_EXECUTE;
    ...

These bitmasks should be properly typed with respect to the original
bitset; which is to say, this should work:

    my Permissions $other_perms = $file_perms +& OTHER_MASK;


-'f


Reply via email to