<?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: How to return multiple values from a method</title>
	<atom:link href="http://www.rubyfleebie.com/how-to-return-multiple-values-from-a-method/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rubyfleebie.com/how-to-return-multiple-values-from-a-method/</link>
	<description>Because programming should be fun</description>
	<lastBuildDate>Thu, 15 Jul 2010 19:48:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Alexwebmaster</title>
		<link>http://www.rubyfleebie.com/how-to-return-multiple-values-from-a-method/comment-page-1/#comment-833</link>
		<dc:creator>Alexwebmaster</dc:creator>
		<pubDate>Tue, 03 Mar 2009 13:12:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubyfleebie.com/how-to-return-multiple-values-from-a-method/#comment-833</guid>
		<description>Hello webmaster 
I would like to share with you a link to your site 
write me here preonrelt@mail.ru</description>
		<content:encoded><![CDATA[<p>Hello webmaster<br />
I would like to share with you a link to your site<br />
write me here <a href="mailto:preonrelt@mail.ru">preonrelt@mail.ru</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Learning Ruby &#38; Rails - July edition &#124; www.neeraj.name</title>
		<link>http://www.rubyfleebie.com/how-to-return-multiple-values-from-a-method/comment-page-1/#comment-334</link>
		<dc:creator>Learning Ruby &#38; Rails - July edition &#124; www.neeraj.name</dc:creator>
		<pubDate>Fri, 03 Aug 2007 13:30:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubyfleebie.com/how-to-return-multiple-values-from-a-method/#comment-334</guid>
		<description>[...] Returning multiple values from a method [...]</description>
		<content:encoded><![CDATA[<p>[...] Returning multiple values from a method [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.rubyfleebie.com/how-to-return-multiple-values-from-a-method/comment-page-1/#comment-289</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Thu, 05 Jul 2007 20:38:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubyfleebie.com/how-to-return-multiple-values-from-a-method/#comment-289</guid>
		<description>Sorry contrived, not convuluted (spelt wrong anyway).

Alex</description>
		<content:encoded><![CDATA[<p>Sorry contrived, not convuluted (spelt wrong anyway).</p>
<p>Alex</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.rubyfleebie.com/how-to-return-multiple-values-from-a-method/comment-page-1/#comment-288</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Thu, 05 Jul 2007 20:37:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubyfleebie.com/how-to-return-multiple-values-from-a-method/#comment-288</guid>
		<description>You are right RSL, although it was a convuluted example. A real world example of usage might be:
@insult_result = a_method_to_insult_innocent_people


In which case both values are used.

To be honest though, returning a hash would probably be nicer for everyone involved :).

Alex</description>
		<content:encoded><![CDATA[<p>You are right RSL, although it was a convuluted example. A real world example of usage might be:<br />
@insult_result = a_method_to_insult_innocent_people</p>
<p>In which case both values are used.</p>
<p>To be honest though, returning a hash would probably be nicer for everyone involved :).</p>
<p>Alex</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: RSL</title>
		<link>http://www.rubyfleebie.com/how-to-return-multiple-values-from-a-method/comment-page-1/#comment-287</link>
		<dc:creator>RSL</dc:creator>
		<pubDate>Thu, 05 Jul 2007 20:13:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubyfleebie.com/how-to-return-multiple-values-from-a-method/#comment-287</guid>
		<description>There&#039;s another reason that Alex&#039;s solution might be less than idea. If you&#039;re returning multiple values but only using one then you&#039;re probably better off with a different method.</description>
		<content:encoded><![CDATA[<p>There&#8217;s another reason that Alex&#8217;s solution might be less than idea. If you&#8217;re returning multiple values but only using one then you&#8217;re probably better off with a different method.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank</title>
		<link>http://www.rubyfleebie.com/how-to-return-multiple-values-from-a-method/comment-page-1/#comment-286</link>
		<dc:creator>Frank</dc:creator>
		<pubDate>Thu, 05 Jul 2007 13:24:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubyfleebie.com/how-to-return-multiple-values-from-a-method/#comment-286</guid>
		<description>@Alex, 

Good observation. It&#039;s true that you have to be careful with statements like &quot;do_whatever if a_method_to_insult_innocent_people&quot; (since it will always return true). 

I don&#039;t dislike your solution (a_method_to_insult_innocent_people.first) but I think I would prefer :  a_method_to_insult_innocent_people[0]. It may feel &quot;less ruby&quot; but it has the advantage of being clear about what the return value really is (an array). On the other hand, if you use &quot;.first&quot;, some could think that your method returned a custom object that contains a method named &quot;first&quot;. Anyway, just a personal taste thing :)

Thanks for your comment</description>
		<content:encoded><![CDATA[<p>@Alex, </p>
<p>Good observation. It&#8217;s true that you have to be careful with statements like &#8220;do_whatever if a_method_to_insult_innocent_people&#8221; (since it will always return true). </p>
<p>I don&#8217;t dislike your solution (a_method_to_insult_innocent_people.first) but I think I would prefer :  a_method_to_insult_innocent_people[0]. It may feel &#8220;less ruby&#8221; but it has the advantage of being clear about what the return value really is (an array). On the other hand, if you use &#8220;.first&#8221;, some could think that your method returned a custom object that contains a method named &#8220;first&#8221;. Anyway, just a personal taste thing :)</p>
<p>Thanks for your comment</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.rubyfleebie.com/how-to-return-multiple-values-from-a-method/comment-page-1/#comment-285</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Wed, 04 Jul 2007 18:46:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubyfleebie.com/how-to-return-multiple-values-from-a-method/#comment-285</guid>
		<description>That&#039;s pretty cool. It&#039;s a bit of a shame that you can&#039;t do:
do_whatever if a_method_to_insult_innocent_people
I guess you could do a_method_to_insult_innocent_people.first instead, although that seems a little ugly.</description>
		<content:encoded><![CDATA[<p>That&#8217;s pretty cool. It&#8217;s a bit of a shame that you can&#8217;t do:<br />
do_whatever if a_method_to_insult_innocent_people<br />
I guess you could do a_method_to_insult_innocent_people.first instead, although that seems a little ugly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://www.rubyfleebie.com/how-to-return-multiple-values-from-a-method/comment-page-1/#comment-284</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Wed, 04 Jul 2007 07:02:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubyfleebie.com/how-to-return-multiple-values-from-a-method/#comment-284</guid>
		<description>This is also how MATLAB handles multiple outputs from functions. Pretty swish.</description>
		<content:encoded><![CDATA[<p>This is also how MATLAB handles multiple outputs from functions. Pretty swish.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
