f# - Can I extend built-in array's indexer? -
I want to add my own pointer to the common array type:
type ' However, it gives a compilation error, "it was likely that the expression was typical of type type." [T] But it has type string (FS0001). " Let's do a = [| 1 |] Let B = A. ["Aa"] / / error: fs 0001 give c = a.item ("aa") // this work. I came to know what was asked 3 years ago and it was suggested that this is an FSRP bug. Want to confirm whether this is still the case, or has the specification been updated since?
I found this question given by Don Sime:
The specification needs to be clarified that the indexers can not be extended for arrays.
I would say that he gave the suggestion to allow them best through the best. He said, this is not easy, because array indices have been "created" in the compiler and no F # or IL Metadata is not representative.
Therefore it is not supported in Fsharp.
Comments
Post a Comment