sorry for making so much noise.. figured it out by myse4lf.
interface IBindingList {
@property bool AllowEdit();
//@property bool AllowEdit(bool enable);
//remove // to enable setter
}
class A : IBindingList {
private bool _allowEdit;
On Tuesday 29 June 2010 03:11:34 BLS wrote:
Just wonder how to translate this C# snippet into D..
//C#
public interface IBindingList {
bool AllowEdit {
get;
}
}
//D2
interface IBindingList {
@property bool allowEdit();
}
Is this correct ? I think in
On 29/06/2010 12:32, Jonathan M Davis wrote:
So, there certainly won't be any restriction on
having a getter or setter in a class if an interface it implements declared only
one. It's just that you'll only be able to use the one that's part of the
interface if you're using a reference of the
On Tue, 29 Jun 2010 06:58:54 -0400, BLS windev...@hotmail.de wrote:
On 29/06/2010 12:32, Jonathan M Davis wrote:
So, there certainly won't be any restriction on
having a getter or setter in a class if an interface it implements
declared only
one. It's just that you'll only be able to use the
BLS:
But this one NOT.
interface IBindingList {
@property bool AllowEdit();
@property bool AllowEdit(bool enable);
}
class A : IBindingList {
private bool _allowEdit;
@property {
bool AllowEdit() { return _allowEdit; }
}
On 29/06/2010 14:08, Steven Schveighoffer wrote:
Besides, try to do this in C#:
@property int value() {return _x;}
@property int value(int x) { return _x = x;}
@property int value(string s) { return _x = to!int(s);}
:) D's properties are so much better...
-Steve
Ok, convinced ;)
Hi bearophile,
sorry for my ignorance, but what is the difference between @disable and
simply deleting the line ?
where can I read more about @disable ?
thanks, bjoern
On Tue, 29 Jun 2010 14:42:33 +0200, BLS windev...@hotmail.de wrote:
Hi bearophile,
sorry for my ignorance, but what is the difference between @disable and
simply deleting the line ?
where can I read more about @disable ?
thanks, bjoern
@disable propagates throughout the objects hierarchy