Skip to content

Instantly share code, notes, and snippets.

@Altreus
Created February 15, 2020 22:27
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 Altreus/f9e40a1e6bc0893575051397f4f3a92a to your computer and use it in GitHub Desktop.
Save Altreus/f9e40a1e6bc0893575051397f4f3a92a to your computer and use it in GitHub Desktop.
> use Object::Delayed;
Nil
> class A { has $.a is rw; has $.b }
(A)
> class B { has $.delegate handles <a b> = slack { A.new(a => 1, b => 2); } }
(B)
> my $b = B.new;
B.new(delegate => A.new(a => 1, b => 2))
> say $b.delegate.defined;
True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment