On Sat, 2015-11-21 at 19:26 +0530, Shriramana Sharma via Digitalmars-d-
learn wrote:
> 
[…]
> Hmm – I forgot Python has `else` for `for` and `while` too. But it's
> a tad 
> difficult to wrap one's mind around the meaning of the word `else` in
> this 
> particular context whereas it actually means `nobreak`. Perhaps if
> this were 
> added to D, `default` would be a better choice of keyword, since we
> all know 
> that `default` (as in `switch`) is not executed if `break` happens.
> 
> So:
> 
> try { code_which_can_throw(); }
> catch { handler(); }
> default { only_if_didnt_throw(); }
> finally { mandatory(); }
> 

There have been, over the years, many debates about changing the "else"
keyword to something else, and always nothing is changed because "else"
is the least worst name. In the case above, I could live with "else" or
"default" since it doesn't have much conflict – but I bet this could
easily become a "bikeshed issue".

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: rus...@winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to