Skip to content

Instantly share code, notes, and snippets.

@polettix
Created June 26, 2021 15:54
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 polettix/9ec1abaf955eb335c15baec45f132208 to your computer and use it in GitHub Desktop.
Save polettix/9ec1abaf955eb335c15baec45f132208 to your computer and use it in GitHub Desktop.
-> ;; $_? is raw = OUTER::<$_> { #`(Block|69979400) ... }
this is baz
-> ;; $_? is raw = OUTER::<$_> { #`(Block|69986960) ... }
this is bar
-> ;; $_? is raw = OUTER::<$_> { #`(Block|69987104) ... }
this is foz
(Callable)
No such method 'CALL-ME' for invocant of type 'Callable'
in method run at attint.raku line 19
in block <unit> at attint.raku line 22
#!/usr/bin/env raku
use v6;
class Foo {
has &!foo = { put 'this is foo' };
has &!bar;
has &!baz;
has &!foz = { put 'this is foz' };
method BUILD (:&!foo, :&!bar = { put 'this is bar' }, :&!baz) {
&!baz //= { put 'this is baz' }
}
method run {
&!baz.say;
&!baz();
&!bar.say;
&!bar();
&!foz.say;
&!foz();
&!foo.say;
&!foo();
}
}
Foo.new.run;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment