Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

statement-ending } with if

0 views
Skip to first unread message

Daniel Hulme

unread,
Jun 6, 2006, 12:26:05 PM6/6/06
to perl6-l...@perl.org
Can someone explain to me how } on a line on its own can end a statement
(as described in the second section of S04), but the following still
works?

if $condition
{
...
}
else
{
...
}

i.e. Why doesn't the } on the fourth line terminate the if statement,
leaving the compiler terminally confused when it sees a bare else? Is
this defined as a special case, and if so, could it be mentioned in S04?
Alternatively, is the else a magic separate statement all of its own?

--
And for mile after mile you'll never see me tire/You'll never me me slow
down for a while/'Cause I am the fox, like it or not/I'm always gonna be
there running over the rock/ Yes I am the fox, a fascinating cross/ Of
sharp as a whip and tough as an ox Bernie Taupin, 'The Fox'

signature.asc
0 new messages