byKey and byValue: properties or methods?
sclytrack
sclytrack at fake.com
Wed Jan 18 00:30:19 PST 2012
>
> Is it practical or realistic to throw it out at this stage? I don't
> know. But there are reasons to.
I hope we are not dropping properties
regardless of the syntax of how to call them.
Keep @property
Keep methods-as-properties
---------------------------------
(a) No ()
obj.property = "test";
string str = obj.property;
obj.method = "string";
obj.method("first");
string str = obj.method;
obj.method("first", "second");
---------------------------------
(b) Optional () for methods
obj.property = "test";
string str = obj.property;
obj.method = "string";
obj.method("first");
string str = obj.method;
string str = obj.method();
obj.method("first", "second");
---------------------------------
(c) Mandatory () for methods
obj.property = "test";
string str = obj.property;
obj.method = "string";
obj.method("first");
string str = obj.method();
obj.method("first", "second");
---------------------------------
(d) Property and Method separated. (Is this the goal for -property?)
obj.property = "test";
string str = obj.property;
string str = obj.method();
obj.method("first");
obj.method("first", "second");
---------------------------------
Who likes (a) ?
Also I think that the @property opDispatch() looks weird.
More information about the Digitalmars-d
mailing list