proposal: allow 'with(Foo):' in addition to 'with(Foo){..}'

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Sun Aug 10 10:29:26 PDT 2014


On 8/10/2014 2:34 AM, "Marc Schütz" <schuetzm at gmx.net>" wrote:
> It's possible to add this syntax for any statement,

The reason for the : syntax for declarations is that modules can be quite long, 
and it:

  1. avoids a lonely } that might be 3000-10,000 lines of code away
  2. avoids requiring indentation of 3000-10,000 lines of code that makes change 
diff's harder

On the other hand, functions tend to be short, and so these are not issues for 
statements. Furthermore, : has other meanings in statements, such as:

  1. labels
  2. case statements
  3. default statements
  4. ?: expressions

and overloading this with more meanings is, in my not-so-humble-opinion, not a 
good idea given the very marginal benefit it might have.



More information about the Digitalmars-d mailing list