<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: C#, The Ternary Operator, and Mono</title>
	<atom:link href="http://definingterms.com/2009/08/18/c-the-ternary-operator-and-mono/feed/" rel="self" type="application/rss+xml" />
	<link>http://definingterms.com/2009/08/18/c-the-ternary-operator-and-mono/</link>
	<description></description>
	<lastBuildDate>Sat, 22 May 2010 01:16:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>By: Crosbie Fitch</title>
		<link>http://definingterms.com/2009/08/18/c-the-ternary-operator-and-mono/comment-page-1/#comment-26787</link>
		<dc:creator>Crosbie Fitch</dc:creator>
		<pubDate>Thu, 20 Aug 2009 14:34:09 +0000</pubDate>
		<guid isPermaLink="false">http://definingterms.com/?p=162#comment-26787</guid>
		<description>You never did say what the output in your last example was, just that it compiled without error.

I presume it outputs &#039;byte&#039;, much to this C++ programmer&#039;s surprise.

You learn something every day.</description>
		<content:encoded><![CDATA[<p>You never did say what the output in your last example was, just that it compiled without error.</p>
<p>I presume it outputs &#8216;byte&#8217;, much to this C++ programmer&#8217;s surprise.</p>
<p>You learn something every day.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam</title>
		<link>http://definingterms.com/2009/08/18/c-the-ternary-operator-and-mono/comment-page-1/#comment-26785</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Thu, 20 Aug 2009 14:00:27 +0000</pubDate>
		<guid isPermaLink="false">http://definingterms.com/?p=162#comment-26785</guid>
		<description>Crosbie,

That&#039;s a reasonable assumption, but it&#039;s not the way C# works.  See part 6.1.8 of the spec.  The key is that if the int is a const, the compiler will look at the value of the int and make sure it fits in the byte.  If the int is small enough to fit, then the compiler does the implicit conversion without warnings or errors.

By the way, you can test it with numeric literals as well, and the bug also exists that way.</description>
		<content:encoded><![CDATA[<p>Crosbie,</p>
<p>That&#8217;s a reasonable assumption, but it&#8217;s not the way C# works.  See part 6.1.8 of the spec.  The key is that if the int is a const, the compiler will look at the value of the int and make sure it fits in the byte.  If the int is small enough to fit, then the compiler does the implicit conversion without warnings or errors.</p>
<p>By the way, you can test it with numeric literals as well, and the bug also exists that way.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Crosbie Fitch</title>
		<link>http://definingterms.com/2009/08/18/c-the-ternary-operator-and-mono/comment-page-1/#comment-26784</link>
		<dc:creator>Crosbie Fitch</dc:creator>
		<pubDate>Thu, 20 Aug 2009 13:47:05 +0000</pubDate>
		<guid isPermaLink="false">http://definingterms.com/?p=162#comment-26784</guid>
		<description>Nothing seems untoward to me.

true?(int)a:(short)b; // is of type int

true?(int)a:(byte)b; // is of type int

Whether a is type byte or b is type int is immaterial.

Are you sure that, despite being a shortening, const int to byte is an implicit conversion (for variables, not numeric literals)? That would surprise me.

const int x=1;
byte b=x; // No shortening warning?

true?x:b; // I&#039;d expect this to have type int - I wouldn&#039;t expect an error because the numeric literal/value held/represented by x could assign/initialise without warning to a byte.</description>
		<content:encoded><![CDATA[<p>Nothing seems untoward to me.</p>
<p>true?(int)a:(short)b; // is of type int</p>
<p>true?(int)a:(byte)b; // is of type int</p>
<p>Whether a is type byte or b is type int is immaterial.</p>
<p>Are you sure that, despite being a shortening, const int to byte is an implicit conversion (for variables, not numeric literals)? That would surprise me.</p>
<p>const int x=1;<br />
byte b=x; // No shortening warning?</p>
<p>true?x:b; // I&#8217;d expect this to have type int &#8211; I wouldn&#8217;t expect an error because the numeric literal/value held/represented by x could assign/initialise without warning to a byte.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Myers (robmyers) 's status on Thursday, 20-Aug-09 11:36:16 UTC - Identi.ca</title>
		<link>http://definingterms.com/2009/08/18/c-the-ternary-operator-and-mono/comment-page-1/#comment-26781</link>
		<dc:creator>Rob Myers (robmyers) 's status on Thursday, 20-Aug-09 11:36:16 UTC - Identi.ca</dc:creator>
		<pubDate>Thu, 20 Aug 2009 11:36:22 +0000</pubDate>
		<guid isPermaLink="false">http://definingterms.com/?p=162#comment-26781</guid>
		<description>[...] Mono and patents - http://definingterms.com/2009/08/18/c-the-ternary-operator-and-mono/ [...]</description>
		<content:encoded><![CDATA[<p>[...] Mono and patents &#8211; <a href="http://definingterms.com/2009/08/18/c-the-ternary-operator-and-mono/" rel="nofollow">http://definingterms.com/2009/08/18/c-the-ternary-operator-and-mono/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://definingterms.com/2009/08/18/c-the-ternary-operator-and-mono/comment-page-1/#comment-26757</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Thu, 20 Aug 2009 02:53:43 +0000</pubDate>
		<guid isPermaLink="false">http://definingterms.com/?p=162#comment-26757</guid>
		<description>None of this would be an issue if patents on software didn&#039;t exist.  Patents were not designed for abstract concepts like software but for actual physical contraptions.  Software patents are the bane of the software development industry and before too long things will come to a head and something will need to be done or the software industry will be in dire straits.

All Software Patents need to be invalidated.</description>
		<content:encoded><![CDATA[<p>None of this would be an issue if patents on software didn&#8217;t exist.  Patents were not designed for abstract concepts like software but for actual physical contraptions.  Software patents are the bane of the software development industry and before too long things will come to a head and something will need to be done or the software industry will be in dire straits.</p>
<p>All Software Patents need to be invalidated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rodrigo Kumpera</title>
		<link>http://definingterms.com/2009/08/18/c-the-ternary-operator-and-mono/comment-page-1/#comment-26745</link>
		<dc:creator>Rodrigo Kumpera</dc:creator>
		<pubDate>Wed, 19 Aug 2009 23:30:59 +0000</pubDate>
		<guid isPermaLink="false">http://definingterms.com/?p=162#comment-26745</guid>
		<description>All standards bodies require some sort of reasonable patent arrangement from the members of the spec. RAND (ECMA) and RAND-ZERO (W3C) are the most common.

If what you state did hold any truth, this would mean that any implementation of any standard would not be protected by those arrangements by simply having a bug.

Let&#039;s not forget that Microsoft holds patents on HTML, TCP, IPv4 and all sort of XML spec. Last time I checked, all browsers had some sort of non-standard behavior.

Everyone agrees that the Community Promise is not the nirvana of patent safety, but arguing that by not been so it worsen the situation or constitutes a threat is a bit too exaggerated.

I find it hard to follow that by been under the CP, mono is actually less safe against MS than any other software that is not.</description>
		<content:encoded><![CDATA[<p>All standards bodies require some sort of reasonable patent arrangement from the members of the spec. RAND (ECMA) and RAND-ZERO (W3C) are the most common.</p>
<p>If what you state did hold any truth, this would mean that any implementation of any standard would not be protected by those arrangements by simply having a bug.</p>
<p>Let&#8217;s not forget that Microsoft holds patents on HTML, TCP, IPv4 and all sort of XML spec. Last time I checked, all browsers had some sort of non-standard behavior.</p>
<p>Everyone agrees that the Community Promise is not the nirvana of patent safety, but arguing that by not been so it worsen the situation or constitutes a threat is a bit too exaggerated.</p>
<p>I find it hard to follow that by been under the CP, mono is actually less safe against MS than any other software that is not.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam</title>
		<link>http://definingterms.com/2009/08/18/c-the-ternary-operator-and-mono/comment-page-1/#comment-26732</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Wed, 19 Aug 2009 20:30:55 +0000</pubDate>
		<guid isPermaLink="false">http://definingterms.com/?p=162#comment-26732</guid>
		<description>James, I suspect you&#039;re right about your interpretation of the meaning of the phrase in the Community Promise, though I don&#039;t have legal training, so I can&#039;t know for sure.  I wasn&#039;t suggesting that breaking with the spec in one detail would void the whole Promise.

All I&#039;m saying is that conforming to the .NET implementation instead of the spec has the potential to create more surface area for a lawsuit, so conforming to the spec is safer.  It&#039;s perfectly reasonable to assume that a compiler bug might be in patented code, which might create some legal uncertainty.  Whether or not Microsoft would choose to act on that is a completely separate matter and I suspect they wouldn&#039;t want to do so.</description>
		<content:encoded><![CDATA[<p>James, I suspect you&#8217;re right about your interpretation of the meaning of the phrase in the Community Promise, though I don&#8217;t have legal training, so I can&#8217;t know for sure.  I wasn&#8217;t suggesting that breaking with the spec in one detail would void the whole Promise.</p>
<p>All I&#8217;m saying is that conforming to the .NET implementation instead of the spec has the potential to create more surface area for a lawsuit, so conforming to the spec is safer.  It&#8217;s perfectly reasonable to assume that a compiler bug might be in patented code, which might create some legal uncertainty.  Whether or not Microsoft would choose to act on that is a completely separate matter and I suspect they wouldn&#8217;t want to do so.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James</title>
		<link>http://definingterms.com/2009/08/18/c-the-ternary-operator-and-mono/comment-page-1/#comment-26731</link>
		<dc:creator>James</dc:creator>
		<pubDate>Wed, 19 Aug 2009 19:28:16 +0000</pubDate>
		<guid isPermaLink="false">http://definingterms.com/?p=162#comment-26731</guid>
		<description>I don&#039;t think this is right, at least on the legal front.  That &quot;to the extent that it conforms to the specifications&quot; just means that you can&#039;t put arbitrary code (potentially violating some other Microsoft patent) and expect it to be covered.  If Microsoft had a patent on the bug, then maybe you&#039;d have a point, but as it stands I don&#039;t think Mono would be giving up any amount of safety by matching Microsoft&#039;s implementation.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t think this is right, at least on the legal front.  That &#8220;to the extent that it conforms to the specifications&#8221; just means that you can&#8217;t put arbitrary code (potentially violating some other Microsoft patent) and expect it to be covered.  If Microsoft had a patent on the bug, then maybe you&#8217;d have a point, but as it stands I don&#8217;t think Mono would be giving up any amount of safety by matching Microsoft&#8217;s implementation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://definingterms.com/2009/08/18/c-the-ternary-operator-and-mono/comment-page-1/#comment-26703</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Wed, 19 Aug 2009 11:21:06 +0000</pubDate>
		<guid isPermaLink="false">http://definingterms.com/?p=162#comment-26703</guid>
		<description>Great article Adam. I didn&#039;t know about the Microsoft policy on bugs in the compiler.</description>
		<content:encoded><![CDATA[<p>Great article Adam. I didn&#8217;t know about the Microsoft policy on bugs in the compiler.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

