Revised RFC on range design for D2
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Fri Oct 3 07:11:09 PDT 2008
Bruno Medeiros wrote:
> Andrei Alexandrescu wrote:
> Yes, we would need an alternate mechanism for properties - an addition
> to the language. And it's quite true that it's likely there would be
> disagreement in the "lot of people" about that. But there is only one
> way to be sure, so we could at least try! Would you and Walter at least
> consider this, and see if we could find an alternative that satisfies a
> fair number of people? Try without compromise.
What I'd consider is not that important. I do know what Walter's
viewpoint is, and that is that there are plenty of bigger rocks to move.
> 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.
> This proposal fixes the ambiguities issues, and require *minimal
> changes* to the language, both in terms of syntax and semantics!
Then what would obj.fun mean when fun is not a property?
Andrei
More information about the Digitalmars-d-announce
mailing list