<?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: Game dev in Scala II</title>
	<atom:link href="http://blog.finiteimprobability.com/2008/03/05/game-dev-in-scala-ii/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.finiteimprobability.com/2008/03/05/game-dev-in-scala-ii/</link>
	<description>Just programming and math, no spontaneously jumping undergarments</description>
	<lastBuildDate>Thu, 19 Nov 2009 10:30:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: James Iry</title>
		<link>http://blog.finiteimprobability.com/2008/03/05/game-dev-in-scala-ii/comment-page-1/#comment-2</link>
		<dc:creator>James Iry</dc:creator>
		<pubDate>Wed, 12 Mar 2008 02:35:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.finiteimprobability.com/?p=13#comment-2</guid>
		<description>&lt;p&gt;&quot;Since Scala doesn&#039;t have a ternary operator (that I know of&quot;&lt;/p&gt;

&lt;p&gt;It does - Scala&#039;s &quot;if&quot; works like both Java&#039;s if and ternary operator.  Without an else it always returns unit and you would only call it for side effects.  With an else it returns the result of the expression evaluated.&lt;/p&gt;

&lt;p&gt;g.setColor(if(s1.intersects(s2)) Color.red else Color.green)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>&#8220;Since Scala doesn&#8217;t have a ternary operator (that I know of&#8221;</p>

<p>It does &#8211; Scala&#8217;s &#8220;if&#8221; works like both Java&#8217;s if and ternary operator.  Without an else it always returns unit and you would only call it for side effects.  With an else it returns the result of the expression evaluated.</p>

<p>g.setColor(if(s1.intersects(s2)) Color.red else Color.green)</p>]]></content:encoded>
	</item>
</channel>
</rss>
