Reinier Zwitserloot wrote: > having foo->bar mean something -entirely- different from foo->bar() > would be extremely bad. > foo.bar means something entirely different than foo.bar(), unless you consider fields and methods to be the same thing.
That said using "->" for both properties and dynamic methods might not be a good idea. > If -> syntax is used for properties, we must accept that -> is 'taken' > and can not be coopted for something else (unless that something is so > close in spirit to properties that it would be allright). So, the > question becomes, for anyone that proposes adding -> for property > reference: Is there another acceptable syntax for dynamic member > resolution, and if not, is this proposal so much cooler than dynamic > member resolution, that its acceptable that they are mutually > exclusive? > > A -great- example of why tossing new syntax at a language 'because > there are no downsides' is faulty thinking. There's always a downside. > > Properties win, by the way, from dynamic member resolution. hands > down. But perhaps -> isn't the right syntax. I'd be just as happy with > just using the ., but forcing explicit declaration of 'property > nature' on the part of the field declaration. writing to/reading from > "this.foo" would always run the getter and setter, no exceptions. If > you want to skip them and read the raw field, the property, which is > really an anonymous inner subclass of the "Property" class, has a > (package?) private field, so, you'd go: "this.foo.field" to read it. > This would only work from the same class (or perhaps from others, if > package private makes more sense). Just throwing it out htere. > Yes, I'd thought of such approaches. They remind me of the ugliest bits introduced with Java 1.1 (e.g. OuterClass.this.field). -- Jess Holle --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaposse?hl=en -~----------~----~----~----~------~----~------~--~---
