"Nick Sabalausky" <[email protected]> wrote in message news:[email protected]... > "Andrei Alexandrescu" <[email protected]> wrote in message > news:[email protected]... >>I hate I must ask this: >> >> int[string] aa; >> foreach (k; aa.byKey) { ... } >> >> or >> >> int[string] aa; >> foreach (k; aa.byKey()) { ... } >> > > Property. It's not an action, you're just accessing a particular interface > of aa. >
Another way you can look at it to make it clear: As far as the caller is concerened, it would have made equal sense if byKey were implemented as a nested struct. Ie, it's data, not action. Just because your implementation happens to involve an imperative block of statements doesn't change the user's perspective of byKey's semantics. Nick "Yes, it is still clear-cut" Sabalausky ;)
