From: Brent Dax [mailto:[EMAIL PROTECTED]]
> Garrett Goebel:
> # Larry Wall in Apocalypse 4 writes:
> # > this special rule only applies to constructs that take a
> # > block (that is, a closure) as their last (or only) argument.
> # > Operators like sort and map are unaffected. However, certain
> # > constructs that used to be in the statement class may become
> # > expression constructs in Perl 6.
> #
> # Does that mean there may still be constructs which take a
> # block, as their last argument, but which don't require a
> # semicolon if they can be written as one-liners?
> #
> # How terribly unpopular would it be if the "when do I need
> # to use a semicolon" question was simply answered:
> #
> # is block-ending construct's final curly on a line by itself ? 0 : 1
> 
> Oooh, there's a problem with that concept:
> 
>       if(foo) {
>               bar
>       }         #There's a semicolon here...
>       else {    #which leaves this else dangling!
>               baz
>       }

Really?

Isn't the C<else>'s block the one with the final curly in the if/elsif/else
statement?

And throwing caution to the wind... I'm one of the fools that prefers:

if foo {
  1
} elsif bar {
  2 
} else {
  3
}

I don't like lining up your C<elsif>'s and C<else>'s with C<if>'s because
visually it makes it look like a separate statement (to me). I don't mean to
disgress into matters of taste... but it would certainly be nice if all
constructs with dangling blocks could be expected to follow the same rules.

Reply via email to