Thread overview | |||||||||
---|---|---|---|---|---|---|---|---|---|
|
May 26, 2002 Any modern language should include PROPERTIES | ||||
---|---|---|---|---|
| ||||
I was giving the WinD samples a quick look and it seems that the new "D" language DOES NOT FEATURE PROPERTIES like C# and Delphi does. This makes it so that one would type: window.top(10); to set the top of the window to 10 instead of the more intuitive window.top = 10; It would be very convenient if D would feature properties like Delphi does. Is there a compelling reason not to have them? |
May 26, 2002 Re: Any modern language should include PROPERTIES | ||||
---|---|---|---|---|
| ||||
Posted in reply to MV | "MV" <luvtech@pacbell.net> wrote in message news:MPG.175a2c345f4b454d989680@news.digitalmars.com... > I was giving the WinD samples a quick look and it seems that the new > "D" language DOES NOT FEATURE PROPERTIES like C# and Delphi does. This > makes it so that one would type: > window.top(10); > to set the top of the window to 10 instead of the more intuitive > window.top = 10; It does. It's just not implemented yet. Properties are defined by a pair of functions with the same name: class Control { void top(int n) { ... } int top() { ... } } Now you can write: Control ctl; ctl.top = 10; printf("%d", ctl.top); |
May 26, 2002 Re: Any modern language should include PROPERTIES | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Minayev | I am impressed. The D language is looking very robust, indeed. The inclusion of properties is a wise decision. Not many people stay online at 1AM PST just to respond to my ranting on. LOL. Thank you for correcting me.
> > I was giving the WinD samples a quick look and it seems that the new
> > "D" language DOES NOT FEATURE PROPERTIES like C# and Delphi does. This
> > makes it so that one would type:
> > window.top(10);
> > to set the top of the window to 10 instead of the more intuitive
> > window.top = 10;
>
> It does. It's just not implemented yet. Properties are defined by a pair of functions with the same name:
>
> class Control
> {
> void top(int n) { ... }
> int top() { ... }
> }
>
> Now you can write:
>
> Control ctl;
> ctl.top = 10;
> printf("%d", ctl.top);
|
May 26, 2002 Re: Any modern language should include PROPERTIES | ||||
---|---|---|---|---|
| ||||
Posted in reply to MV | "MV" <luvtech@pacbell.net> wrote in message news:MPG.175a36db4482017f989681@news.digitalmars.com... > I am impressed. The D language is looking very robust, indeed. The inclusion of properties is a wise decision. Not many people stay online at 1AM PST just to respond to my ranting on. LOL. Thank you for correcting me. Well, it's GMT+3 where I live. =) |
May 27, 2002 Re: Any modern language should include PROPERTIES | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Minayev | >Well, it's GMT+3 where I live. =)
Aww, we thought you were hardcore...
|
May 27, 2002 Re: Any modern language should include PROPERTIES | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Minayev | >Well, it's GMT+3 where I live. =)
Aww, we thought you were hardcore...
|
May 29, 2002 Re: Any modern language should include PROPERTIES | ||||
---|---|---|---|---|
| ||||
Posted in reply to James Yates | "James Yates" <James_member@pathlink.com> wrote in message news:acu0nq$25i6$1@digitaldaemon.com... > >Well, it's GMT+3 where I live. =) > Aww, we thought you were hardcore... > He *is*, trust me! :) -- Stijn OddesE_XYZ@hotmail.com http://OddesE.cjb.net _________________________________________________ Remove _XYZ from my address when replying by mail |
Copyright © 1999-2021 by the D Language Foundation