Skip to content

Instantly share code, notes, and snippets.

View AlexDaniel's full-sized avatar

Aleks-Daniel Jakimenko-Aleksejev AlexDaniel

  • Tallinn, Estonia
View GitHub Profile
@AlexDaniel
AlexDaniel / Foo.pm6
Last active October 5, 2018 23:11 — forked from mwienand/Foo.pm6
re-export p6
use FooBar;
module Foo {
sub foo is export { "foo" ~ bar() }
}
sub EXPORT {
FooBar::EXPORT::DEFAULT::
}
use v6;
my int $max = 2_000_000 × 4;
# find all primes up to $max using The Sieve of Erathostenes
my int @a = (0..$max);
for (2..($max div 2)) -> int $i {
my int $j = 2;
@a[$i * $j++] = 1 while $i * $j <= $max;
}
# MAIN
require ($*PROGRAM.parent.absolute ~ "/to_require.pm") <required_role> ;
my $c = 1 does required_role ;
@AlexDaniel
AlexDaniel / query
Created September 28, 2019 19:02 — forked from Whateverable/query
evalable6
.say for ^888
@AlexDaniel
AlexDaniel / query
Created October 19, 2019 16:31 — forked from Whateverable/query
greppable6
≠|≤|≥
@AlexDaniel
AlexDaniel / ootut2.pm6
Last active March 18, 2020 18:55 — forked from wildwildtrees/ootut2.pm6
bug free, but bugs out when follow is called with "Cannot invoke this object (REPR: Null; VMNull)" if I change self.id to self!id in method follow in role Follow line 52
our %world = {} ;
role Identifier {
has $.id is rw ;
}
role Container {
has @.contents is rw ;
method add($item) {
@!contents.push($item) ;