Skip to content

Instantly share code, notes, and snippets.

@dakkar
Created May 31, 2019 08:40
Show Gist options
  • Save dakkar/2fae824eb5d3b0085ef4aec2aeb298fc to your computer and use it in GitHub Desktop.
Save dakkar/2fae824eb5d3b0085ef4aec2aeb298fc to your computer and use it in GitHub Desktop.
splat a supply inside another
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