Skip to content

Instantly share code, notes, and snippets.

@moritz
Created November 26, 2016 21:16
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 moritz/5fe8be212699be4f79559910b3f1ec58 to your computer and use it in GitHub Desktop.
Save moritz/5fe8be212699be4f79559910b3f1ec58 to your computer and use it in GitHub Desktop.
Potential Rakudobug
role LL[::T] {
has T $.item;
has LL[T] $.next;
method visit(&c) {
c($.item);
$.next.visit(&c) if $.next;
}
}
my $t = LL[Int].new(
item => 5,
next => LL[Int].new( item => 4 ),
);
say $t.perl;
$t.visit(&say);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment