Using memberspaces for a property-like syntax and more

TommiT tommitissari at hotmail.com
Sat Feb 2 08:15:42 PST 2013


On Saturday, 2 February 2013 at 13:03:49 UTC, Era Scarecrow wrote:
>  First impression: I don't know why but I don't like it.
> [..]

Also, let's not miss the fact, that this proposal isn't really 
about properties anymore. It's about being able to divide your 
interface into multiple logical sections. It just so happens to 
be that this ability lends itself pretty nicely to implementing 
something that *looks* like a property.

There's nothing that says you should use opCall as the getter of 
your "property" like this:
var.prop()
...instead, it could use a method like:
var.prop.get()
...and you could even have multiple getters:
var.prop.get_regular()
var.prop.get_filtered()

I just thought that the use of opCall for 'properties' might be a 
good convention.


More information about the Digitalmars-d mailing list