tags:

views:

54

answers:

2

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 mention of it on the interwebs.

Can anyone verify its existence and point me in the right direction or is the syntactic equivalent of bigfoot?

+1  A: 

you have been fooled :)

lukas
+5  A: 

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:

alt text

Rex M
You have to love the Schrödinger's Cat example. Classic.
Oppositional
Huh. I wondered. int.Parse() it is then.
Phil.Wheeler
Ha! Funny illustration. If I'd been able to turn up better search results on Bing or Google, I might've saved myself some time and embarrassment.
Phil.Wheeler