Revised RFC on range design for D2
Benji Smith
dlanguage at benjismith.net
Fri Oct 3 10:53:33 PDT 2008
Andrei Alexandrescu wrote:
> Bruno Medeiros wrote:
>> In fact, I'm also not a fan of those complex property mechanisms, à lá
>> C#. I think a fair candidate would be Bill Baxter's proposal, the
>> 'property' keyword:
>>
>> property int foo() { return _foo; };
>> property void foo(int foo) { _foo = foo; };
>>
>> The property keyword would make a function callable *only* as a
>> property syntax (either as reading, 'bar = foo;', or as writing, 'foo
>> = 42;'). A function signature which was not adequate for property
>> access would be compile-time error.
>
> Then what would obj.fun mean when fun is not a property?
>
> Andrei
If I understand the proposal correctly, it would be a compile-time error.
--benji
More information about the Digitalmars-d-announce
mailing list