On Wed, May 01, 2002 at 08:27:41AM -0400, 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 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.

Hmm.  I wonder why the python community (apparently) have no problems
with elses on loops:

        7.2 The while statement

        The while statement is used for repeated execution as long as an
        expression is true: 
        
        while_stmt ::= "while" expression ":" suite
                        ["else" ":" suite]

That's straight from http://www.python.org/doc/current/ref/while.html.
If you read the page though, you'll see that their meaning isn't
dwimmery at all. The else block is executed whenever the expression
evaluates to false which could be if there's nothing to iterate over
or just after the last iteration.

-Scott
-- 
Jonathan Scott Duff
[EMAIL PROTECTED]

Reply via email to