-
-
Save RomanHargrave/6afaea7a299c016811226eab4d6f78ec to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env raku | |
class Bar { | |
has $.l = "left value"; | |
has $.r = "right value"; | |
multi method get(:$lhs) { $.l } | |
multi method get(:$rhs) { $.r } | |
method something(Int $depth = 0, |p) { | |
"this is a Bar of " ~ self.get(|p); | |
} | |
} | |
multi get(:$lhs) { "left" } | |
multi get(:$rhs) { "right" } | |
sub whatever(Int $depth = 0, |p) { | |
"whatever = " ~ get(|p); | |
} | |
say Bar.new.something(:lhs); | |
say Bar.new.something(:rhs); | |
say whatever(:lhs); | |
say whatever(:rhs); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment