|
|
|
I don't think the [default] attribute is what is needed.
C#'s way of doing this(index) is a very nice syntax. It's clear and to the point and you'll know what to expect even before you know what an indexer does. Just noting. Syntax for default indexers will use "self" with square brackets instead of parentheses:
class Alpha: And non-default indexed properties will switch over to square brackets instead of parentheses too: class Person: And manual use of [DefaultMember] attribute will be deprecated. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
class Alpha:
[default] Item(index):
get:
return DoSometing(index)
No special syntax and semantics needed.