Joshua Gatcomb writes:
> The solution is formal parameters.  The trouble is I
> can't seem to find a good example in S04 that matches
> what I am trying to do.
> 
> while $ref() -> @array { ... }

We're thinking at the moment that `while` will probably look like this:

    sub statement:<while> (&cond is lazy, &block) {
        my $cond;

        again:
        $cond = &cond();
        return $cond unless $cond;
        &block.arity ? &block($cond) : &block;
        goto again;
    }

That does pose a problem with:

    given $foo {
        until $_.leaf {
            ^process;        # uh oh, means $foo.leaf.process
            $_ = ^next;
        }
    }

Using the "best so far" proposal for calling methods on $_.  Allow this
to serve as an example for how it will look in real code.

Luke

Reply via email to