Skip to content

Instantly share code, notes, and snippets.

@skids
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skids/f55b1106964e500f5d60 to your computer and use it in GitHub Desktop.
Save skids/f55b1106964e500f5d60 to your computer and use it in GitHub Desktop.
# Still golfing, but this is metastable under moarvm on my system.
# Try: for i in 0 1 2 3 4 5 6 7 8 9 ; do perl6 this_file.pm6; done;
class C {
my %store{Any};
multi method foo is rw {
%store{self}<foo> //= [];
%store{self}<foo>;
}
multi method bar is rw {
%store{self}<bar> //= False;
%store.keys.say;
%store{self}<bar>;
}
}
my C $c .= new();
sleep(0.01.rand);
sleep(0.01.rand);
sleep(0.01.rand);
sleep(0.01.rand);
sleep(0.01.rand);
"OHAI".say;
$c.foo.push(True,False,True,False,True);
$c.foo.splice(0,2);
$c.bar = True;
$c.foo.push(False,True) if $c.bar;
$c.foo.perl.say;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment