www.digitalmars.com         C & C++   DMDScript  

D - Any modern language should include PROPERTIES

reply MV <luvtech pacbell.net> writes:
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
parent reply "Pavel Minayev" <evilone omen.ru> writes:
"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
parent reply MV <luvtech pacbell.net> writes:
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
parent reply "Pavel Minayev" <evilone omen.ru> writes:
"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 26 2002
next sibling parent James Yates <James_member pathlink.com> writes:
Well, it's GMT+3 where I live. =)

May 27 2002
prev sibling parent reply James Yates <James_member pathlink.com> writes:
Well, it's GMT+3 where I live. =)

May 27 2002
parent "OddesE" <OddesE_XYZ hotmail.com> writes:
"James Yates" <James_member pathlink.com> wrote in message
news:acu0nq$25i6$1 digitaldaemon.com...
Well, it's GMT+3 where I live. =)


He *is*, trust me! :) -- Stijn OddesE_XYZ hotmail.com http://OddesE.cjb.net _________________________________________________ Remove _XYZ from my address when replying by mail
May 29 2002