Help language development. Donate to The Perl Foundation

BitEnum cpan:CTILMES last updated on 2020-04-23

eg/combos.raku
#!/usr/bin/env raku

use BitEnum;

my enum MyBits (
    A => 0x01,
    B => 0x02,
    C => 0x04,
    D => 0x08,
);

my enum Combos (
    AB => 0x03,
    BC => 0x06,
);

my $x = BitEnum[MyBits].new(6);

say $x;

$x.set(AB, C);

say $x;