Jonathan Scott Duff <[EMAIL PROTECTED]> wrote:
> Miko O'Sullivan wrote:
> > Damian said:
> > > 6. C<otherwise> would seem to fit the bill rather nicely.
> >
> > To me, "otherwise" is a synonym for "else", and that makes it too
> > confusingly similar. I foresee forever explaining to people the difference
> > between C<else> and C<otherwise>. I'm not sure if C<otherwise> is popular
> > because it is similar to C<else>, but I think the similarity is a reason
> > *not* to use it.
I don't care about the similarity in meaning, the visual distinction would be
nice though.
> I actually think exactly the opposite. In my mind "otherwise" would
> just be a synonym for "else" so that
>
> loop { ... } else { ... }
> loop { ... } otherwise { ... }
>
> would both be syntactically valid. We would just encourage people to
> use the "otherwise" version for understandability. Since there's no
> difference between them, there's nothing to explain there, thus no
> confusion.
This now becomes confusing (to me):
if ($foo = 'bar') {
loop {
...
}
else {
...
}
....
}
and this insane:
loop {
...
}
else {
...
} if ...;
Where if you intent say the normal 1-3 times then it might be VERY confusing to see
mixed
conditionals and loops. I think the fall through (currently mumbled as 'otherwise')
should be a
different keyword to make it visually distinct. I suspect Larry has the solution.
Anyone who hasn't seen virtually impossible to avoid intents to the 6th (or
thereabouts) level
should email me for a sample. The Games::Golf, _unix_capture() method has them
because it's
combining signals (requiring double eval), IPC::Open3 and limits (on output length,
time etc). I
should make this a plea for a bugfix team, it's riddled with them. ;-)
However, the currect interface for IO::Select and this loop/otherwise type construct
would be
great fun. Whenever it's included, can someone please travel back in time and put in
into Perl 5,
please?
> Hmm. I wonder why the python community (apparently) have no problems
> with elses on loops:
I hazard a guess that facist whitespace rules have something to do with it.
Jonatha Paton
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com