-
-
Save treyharris/e029f2c0c05cbef65a9ed51e41ab2854 to your computer and use it in GitHub Desktop.
Delayed object REPL interaction
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
> 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; say $b.delegate.defined; | |
False | |
> say $b.delegate.defined; | |
False | |
> $b | |
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