-
-
Save polettix/16ffed140530e4f100c1786d34912dcb to your computer and use it in GitHub Desktop.
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
$ raku --version | |
Welcome to ๐๐๐ค๐ฎ๐๐จโข v2021.06. | |
Implementing the ๐๐๐ค๐ฎโข programming language v6.d. | |
Built on MoarVM version 2021.06. | |
$ raku attint.raku | |
-> ;; $_? is raw = OUTER::<$_> { #`(Block|82273360) ... } | |
this is baz | |
-> ;; $_? is raw = OUTER::<$_> { #`(Block|82280920) ... } | |
this is bar | |
(Callable) | |
No such method 'CALL-ME' for invocant of type 'Callable' | |
in method run at attint.raku line 16 | |
in block <unit> at attint.raku line 19 |
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
#!/usr/bin/env raku | |
use v6; | |
class Foo { | |
has &!foo = { put 'this is foo' }; | |
has &!bar; | |
has &!baz; | |
method BUILD (:&!foo, :&!bar = { put 'this is bar' }, :&!baz) { | |
&!baz //= { put 'this is baz' } | |
} | |
method run { | |
&!baz.say; | |
&!baz(); | |
&!bar.say; | |
&!bar(); | |
&!foo.say; | |
&!foo(); | |
} | |
} | |
Foo.new.run; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment