<?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: Evil: knowing when a method got passed the default value</title>
	<atom:link href="http://ruby.tie-rack.org/64/evil-knowing-when-a-method-got-passed-the-default-value/feed/" rel="self" type="application/rss+xml" />
	<link>http://ruby.tie-rack.org/64/evil-knowing-when-a-method-got-passed-the-default-value/</link>
	<description>Ruby.send(:stop, 'messing around')</description>
	<pubDate>Wed, 20 Aug 2008 18:35:44 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: Ben Goering</title>
		<link>http://ruby.tie-rack.org/64/evil-knowing-when-a-method-got-passed-the-default-value/#comment-503</link>
		<dc:creator>Ben Goering</dc:creator>
		<pubDate>Wed, 16 Apr 2008 23:00:19 +0000</pubDate>
		<guid isPermaLink="false">http://ruby.tie-rack.org/64/evil-knowing-when-a-method-got-passed-the-default-value/#comment-503</guid>
		<description>What a fabulous way to humiliate fools!

Cool post, though. Even a ruby noob like me can understand it!</description>
		<content:encoded><![CDATA[<p>What a fabulous way to humiliate fools!</p>
<p>Cool post, though. Even a ruby noob like me can understand it!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Shea</title>
		<link>http://ruby.tie-rack.org/64/evil-knowing-when-a-method-got-passed-the-default-value/#comment-497</link>
		<dc:creator>Chris Shea</dc:creator>
		<pubDate>Sun, 13 Apr 2008 15:47:15 +0000</pubDate>
		<guid isPermaLink="false">http://ruby.tie-rack.org/64/evil-knowing-when-a-method-got-passed-the-default-value/#comment-497</guid>
		<description>@João: The original problem was that I had a method that should take any object whatsoever and return something based on that, but return something else if the method wasn't passed anything. A default value of nil wouldn't help in that case, because the method was expected to handle nil just like everything else.

The solution I ended up with was to rethink my approach. But x=(x_not_given = true) could have worked.</description>
		<content:encoded><![CDATA[<p>@João: The original problem was that I had a method that should take any object whatsoever and return something based on that, but return something else if the method wasn&#8217;t passed anything. A default value of nil wouldn&#8217;t help in that case, because the method was expected to handle nil just like everything else.</p>
<p>The solution I ended up with was to rethink my approach. But x=(x_not_given = true) could have worked.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: João Paulo Lins</title>
		<link>http://ruby.tie-rack.org/64/evil-knowing-when-a-method-got-passed-the-default-value/#comment-496</link>
		<dc:creator>João Paulo Lins</dc:creator>
		<pubDate>Sun, 13 Apr 2008 15:16:09 +0000</pubDate>
		<guid isPermaLink="false">http://ruby.tie-rack.org/64/evil-knowing-when-a-method-got-passed-the-default-value/#comment-496</guid>
		<description>I think to do conditional within method is best, because code is more legible and safe.However is like you said: "Use that at your own peril."

def greet_world(salutation = nil)
salutation = salutation.nil? ? 'Hello' : salutation == 'Hello' ? 'YOU HAVE NO IMAGINATION!' : salutation
end</description>
		<content:encoded><![CDATA[<p>I think to do conditional within method is best, because code is more legible and safe.However is like you said: &#8220;Use that at your own peril.&#8221;</p>
<p>def greet_world(salutation = nil)<br />
salutation = salutation.nil? ? &#8216;Hello&#8217; : salutation == &#8216;Hello&#8217; ? &#8216;YOU HAVE NO IMAGINATION!&#8217; : salutation<br />
end</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: crayz</title>
		<link>http://ruby.tie-rack.org/64/evil-knowing-when-a-method-got-passed-the-default-value/#comment-495</link>
		<dc:creator>crayz</dc:creator>
		<pubDate>Sun, 13 Apr 2008 03:57:36 +0000</pubDate>
		<guid isPermaLink="false">http://ruby.tie-rack.org/64/evil-knowing-when-a-method-got-passed-the-default-value/#comment-495</guid>
		<description>Wow, just wow. That is ridiculous, but I can actually see it coming in handy sometimes (e.g. maintaining backwards compatibility with an API that's changing default values in a method call)

Very cool tip</description>
		<content:encoded><![CDATA[<p>Wow, just wow. That is ridiculous, but I can actually see it coming in handy sometimes (e.g. maintaining backwards compatibility with an API that&#8217;s changing default values in a method call)</p>
<p>Very cool tip</p>
]]></content:encoded>
	</item>
</channel>
</rss>
