<?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"
	>
<channel>
	<title>Comments on: Ruby min/max</title>
	<atom:link href="http://blog.projectxtech.com/2006/11/10/ruby-minmax/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.projectxtech.com/2006/11/10/ruby-minmax/</link>
	<description>Start-ups, Maps and Local Search in New Zealand</description>
	<pubDate>Fri, 08 Aug 2008 00:37:39 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: Rob Morris</title>
		<link>http://blog.projectxtech.com/2006/11/10/ruby-minmax/#comment-1174</link>
		<dc:creator>Rob Morris</dc:creator>
		<pubDate>Thu, 08 May 2008 21:12:35 +0000</pubDate>
		<guid isPermaLink="false">http://admin2.projectx.co.nz/blogtest/?p=167#comment-1174</guid>
		<description>Sorry, got garbled, here's another attempt:

module Math
    def self.min(a,b)
        a &#60;= b ? a : b
    end

    def self.max(a,b)
        a &#62;= b ? a : b
    end
end</description>
		<content:encoded><![CDATA[<p>Sorry, got garbled, here&#8217;s another attempt:</p>
<p>module Math<br />
    def self.min(a,b)<br />
        a &lt;= b ? a : b<br />
    end</p>
<p>    def self.max(a,b)<br />
        a &gt;= b ? a : b<br />
    end<br />
end</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Morris</title>
		<link>http://blog.projectxtech.com/2006/11/10/ruby-minmax/#comment-1173</link>
		<dc:creator>Rob Morris</dc:creator>
		<pubDate>Thu, 08 May 2008 21:11:25 +0000</pubDate>
		<guid isPermaLink="false">http://admin2.projectx.co.nz/blogtest/?p=167#comment-1173</guid>
		<description>I find the "official" version very counter-intuitive.  My first thought, when coding up a comparison, is not to create a transient array.

If you're like me, throw this into your environment.rb or similar init code:

module Math
    def self.min(a,b)
        a = b ? a : b
    end
end

Now you can do Math.min(1,2) and be a little more clear on what you're doing.  Cheers!</description>
		<content:encoded><![CDATA[<p>I find the &#8220;official&#8221; version very counter-intuitive.  My first thought, when coding up a comparison, is not to create a transient array.</p>
<p>If you&#8217;re like me, throw this into your environment.rb or similar init code:</p>
<p>module Math<br />
    def self.min(a,b)<br />
        a = b ? a : b<br />
    end<br />
end</p>
<p>Now you can do Math.min(1,2) and be a little more clear on what you&#8217;re doing.  Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy Roush</title>
		<link>http://blog.projectxtech.com/2006/11/10/ruby-minmax/#comment-989</link>
		<dc:creator>Jeremy Roush</dc:creator>
		<pubDate>Wed, 07 Nov 2007 14:36:13 +0000</pubDate>
		<guid isPermaLink="false">http://admin2.projectx.co.nz/blogtest/?p=167#comment-989</guid>
		<description>Old post, but useful. Much appreciated!</description>
		<content:encoded><![CDATA[<p>Old post, but useful. Much appreciated!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
