タグ

coroに関するsrkzhrのブックマーク (1)

  • Perlで学ぶコルーチン

    8. say quot;startquot;; sub say_hello { say_hello(10); my $n = shift; for (1..$n) { say 'hello'; } return; } say quot;endquot;; 10. my $c = Fiber>new( $c‐>resume; sub{ say 'hello!'; Fiber‐>yield; say 'happy'; $c‐>resume; say 'perl'; Fiber‐>yield; say 'coding'; $c‐>resume; say 'world!'; } ); 11. my $c = Fiber>new( $c‐>resume; sub{ say 'hello!'; Fiber‐>yield; say 'happy'; hello happy $c‐>resume; say

    Perlで学ぶコルーチン
  • 1