.Net 4 StringOrInt type
I'm sure I read on Scott Gu's blog (or somewhere equally authoritative) that .net 4 was introducing a new type: StringOrInt. This was some time ago and may have been an April Fool's joke, but I'm having a hard time finding any m开发者_C百科ention of it on the interwebs.
Can anyone verify its existence and point me in the right direction or is the syntactic equivalent of bigfoot?
StringOr<TOther>
was indeed an April Fools joke, posted on Eilon Lipton's blog and repeated and extended by other notable individuals on the various .NET teams.
If the consumer of this API wants the original value, they can use the StringValue property. Otherwise they can use the OtherValue property, which in this case is the successfully parsed integer.
The following diagram illustrates the dichotomy with a scenario familiar to many physicists:
(source: asp.net)
you have been fooled :)
精彩评论