Like ruby, F# can define indexer as defining Item property.
defining
member this.Item (idx : int) =accessing
...
xxx.[42]
And also like ruby, indexer can take one more arguments.
defining
member this.Item (prefix : string , idx : int) =accessing
...
xxx.["Answer", 42]
No comments:
Post a Comment