Omittable parens is an evil

Mike vertex at gmx.at
Sat Jul 19 07:01:53 PDT 2008


On Sat, 19 Jul 2008 15:32:36 +0200, Koroskin Denis <2korden+dmd at gmail.com>  
wrote:

> Why not have special syntax for properties, like:

This has come up multiple times - that's one of the few things where C#  
wins over D. If I may repeat a suggestion I made once, maybe Walter can be  
hypnotized into implementing it if I just repeat it often enough :)

class foo
{
     private int _bar;
     property int bar
     {
         opGet() { return _bar; }
         opSet(auto value) { _bar = value; }
         opAddAssign(auto value) { _bar += value; } // it's extremely  
extendable!
     }
}

-Mike

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/



More information about the Digitalmars-d mailing list