Would that then imply that

     sub blah {
       ...              # 1
       return if $a;    # 2
       ...              # 3
     }

...would return $a if $a was true, and fall through to (3) if it was
false?


It sure should, provided there were a correct context waiting, which would
quite nicely address another WIBNI thread a couple of months back about a
quick return under those conditions.

I.... don't think so. I say that all the time to mean precisely:


if $a { return }

And I don't think people are ready to give that up.

In particular, if we kept our bottom-up parser around, this particular
construct would cause an infinite-lookahead problem. So for ambiguity's
sake, C<if $a> should not be a valid term without a block following.

So, just to make sure, these two lines are both valid, but do completely different things:


        return if $a;
        return if $a { $a }


MikeL




Reply via email to