[Not back, just sufficiently irritated...]

Luke Palmer wrote:

in my proposal, when you call a coroutine, it returns an iterator (and
doesn't call anything):

    my $example = example();
    =$example;  # 1
    =$example;  # 2

The thing this buys over the traditional (which I refer to as the
"stupid") way, is that you can do this:

    my $example = example();
    my $example2 = example();
    =$example; # 1
    =$example; # 2
    =$example2; # 1
    =$example; # 3

There is _no way_ to do that using the stupid way.

Nonsense. You just return an anonymous coroutine:

    sub example { coro {...} }

    my $example  = example();
    my $example2 = example();

    $example();  # 1
    $example();  # 2
    $example2(); # 1
    $example();  # 3

Damian

Reply via email to