Created
May 31, 2019 08:40
-
-
Save dakkar/2fae824eb5d3b0085ef4aec2aeb298fc to your computer and use it in GitHub Desktop.
splat a supply inside another
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
use v6; | |
use experimental :macros; | |
macro splat-supply($b) { quasi { with {{{$b}}} { .tap:{ emit $_ }; .wait } } } | |
sub x { supply { emit 2; emit 3 } } | |
sub y { supply { emit 1; splat-supply x(); emit 4 } } | |
y.tap(*.say); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment