-
-
Save moritz/5fe8be212699be4f79559910b3f1ec58 to your computer and use it in GitHub Desktop.
Potential Rakudobug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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