On Thu, 2002-04-25 at 18:20, Damian Conway wrote:
> Miko O'Sullivan wrote:

> >  before  { ... }     # run before first iteration,
> >                      # only if there is at least one iteration
> 
> Larry is still considering allowing a C<FIRST> block that would do this.
[...]
> This will be called a C<NEXT> block. It goes inside the loop block.
[...]
> This will be called a C<LAST> block. It goes inside the loop block.
[...]
> C<else> blocks to accomplish this.

This bothers me. Traditionally, all-caps keywords in Perl have indicated
compile-time constructs that may relate only loosely to the code around
them (e.g. BEGIN, END).

Why would these keywords need to be set off in this fashion? Is there
something dangerous about:

        for @x->$y {
                first { ... }
                ...
                next { ... }
                last { ... }
        } else {
                ...
        }

I can see next and last being confusing, and you might want to choose
other keywords, but making them upper-case doesn't really eliminate the
confusion.

Also, first is perhaps a poor keyword itself. What about this case:

        for @x->$y {
                if (defined $y) {
                        first { ... }
                }
        }

Does that work?


Reply via email to