<?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: Method Arguments In Ruby</title> <atom:link href="http://www.skorks.com/2009/08/method-arguments-in-ruby/feed/" rel="self" type="application/rss+xml" /><link>http://www.skorks.com/2009/08/method-arguments-in-ruby/</link> <description>For the betterment of the software craft...</description> <lastBuildDate>Mon, 21 Nov 2011 13:57:06 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.1.2</generator> <item><title>By: Ramya</title><link>http://www.skorks.com/2009/08/method-arguments-in-ruby/comment-page-1/#comment-7525</link> <dc:creator>Ramya</dc:creator> <pubDate>Mon, 10 Oct 2011 20:03:03 +0000</pubDate> <guid
isPermaLink="false">http://www.skorks.com/?p=1043#comment-7525</guid> <description>Great post, Helped in getting started</description> <content:encoded><![CDATA[<p>Great post, Helped in getting started</p> ]]></content:encoded> </item> <item><title>By: Sławosz</title><link>http://www.skorks.com/2009/08/method-arguments-in-ruby/comment-page-1/#comment-7305</link> <dc:creator>Sławosz</dc:creator> <pubDate>Fri, 19 Aug 2011 09:35:23 +0000</pubDate> <guid
isPermaLink="false">http://www.skorks.com/?p=1043#comment-7305</guid> <description>It is usefull when you override method:
class A
def render(a,b,*args,&amp;blk)
#...
end
end
class B &lt; A
def render(*)
# do something without arguments
end
end
So you dont need to rewrite arguments signature in overrided method. Sometimes usefull.
PS. Nice article!</description> <content:encoded><![CDATA[<p>It is usefull when you override method:</p><p>class A<br
/> def render(a,b,*args,&amp;blk)<br
/> #&#8230;<br
/> end<br
/> end</p><p>class B &lt; A<br
/> def render(*)<br
/> # do something without arguments<br
/> end<br
/> end</p><p>So you dont need to rewrite arguments signature in overrided method. Sometimes usefull.</p><p>PS. Nice article!</p> ]]></content:encoded> </item> <item><title>By: Michael Nissim</title><link>http://www.skorks.com/2009/08/method-arguments-in-ruby/comment-page-1/#comment-6099</link> <dc:creator>Michael Nissim</dc:creator> <pubDate>Mon, 02 Aug 2010 08:42:26 +0000</pubDate> <guid
isPermaLink="false">http://www.skorks.com/?p=1043#comment-6099</guid> <description>I find your site, and this article too, very useful, readable and pleasant. I like the funny pictures of &quot;arguments&quot; you put too! May God bless you!</description> <content:encoded><![CDATA[<p>I find your site, and this article too, very useful, readable and pleasant. I like the funny pictures of &#8220;arguments&#8221; you put too! May God bless you!</p> ]]></content:encoded> </item> <item><title>By: Saw some good blogs on RoR &#171; Raymond Gao&#8217;s blog</title><link>http://www.skorks.com/2009/08/method-arguments-in-ruby/comment-page-1/#comment-6074</link> <dc:creator>Saw some good blogs on RoR &#171; Raymond Gao&#8217;s blog</dc:creator> <pubDate>Mon, 12 Jul 2010 17:07:19 +0000</pubDate> <guid
isPermaLink="false">http://www.skorks.com/?p=1043#comment-6074</guid> <description>[...] on passing method(a, b, *p) -&gt; hash of arguments to the methods http://www.skorks.com/2009/08/method-arguments-in-ruby/   Share and [...]</description> <content:encoded><![CDATA[<p>[...] on passing method(a, b, *p) -&gt; hash of arguments to the methods <a
href="http://www.skorks.com/2009/08/method-arguments-in-ruby/" rel="nofollow">http://www.skorks.com/2009/08/method-arguments-in-ruby/</a> Share and [...]</p> ]]></content:encoded> </item> <item><title>By: ochronus</title><link>http://www.skorks.com/2009/08/method-arguments-in-ruby/comment-page-1/#comment-3497</link> <dc:creator>ochronus</dc:creator> <pubDate>Mon, 08 Feb 2010 21:17:03 +0000</pubDate> <guid
isPermaLink="false">http://www.skorks.com/?p=1043#comment-3497</guid> <description>Nice article, very informative!
I&#039;ve also written a quick intro in the topic: http://blog.mostof.it/posts/why-ruby-part-three-method-arguments/</description> <content:encoded><![CDATA[<p>Nice article, very informative!<br
/> I&#8217;ve also written a quick intro in the topic: <a
href="http://blog.mostof.it/posts/why-ruby-part-three-method-arguments/" rel="nofollow">http://blog.mostof.it/posts/why-ruby-part-three-method-arguments/</a></p> ]]></content:encoded> </item> <item><title>By: The Rubyist: August 2009 Edition</title><link>http://www.skorks.com/2009/08/method-arguments-in-ruby/comment-page-1/#comment-2674</link> <dc:creator>The Rubyist: August 2009 Edition</dc:creator> <pubDate>Tue, 08 Sep 2009 01:09:28 +0000</pubDate> <guid
isPermaLink="false">http://www.skorks.com/?p=1043#comment-2674</guid> <description>[...] Method Arguments In Ruby [...]</description> <content:encoded><![CDATA[<p>[...] Method Arguments In Ruby [...]</p> ]]></content:encoded> </item> <item><title>By: Alan Skorkin</title><link>http://www.skorks.com/2009/08/method-arguments-in-ruby/comment-page-1/#comment-2342</link> <dc:creator>Alan Skorkin</dc:creator> <pubDate>Thu, 27 Aug 2009 02:22:02 +0000</pubDate> <guid
isPermaLink="false">http://www.skorks.com/?p=1043#comment-2342</guid> <description>That does look pretty cool, cheers for that.</description> <content:encoded><![CDATA[<p>That does look pretty cool, cheers for that.</p> ]]></content:encoded> </item> <item><title>By: roger</title><link>http://www.skorks.com/2009/08/method-arguments-in-ruby/comment-page-1/#comment-2331</link> <dc:creator>roger</dc:creator> <pubDate>Wed, 26 Aug 2009 19:01:47 +0000</pubDate> <guid
isPermaLink="false">http://www.skorks.com/?p=1043#comment-2331</guid> <description>also check out http://github.com/maca/arguments very cool</description> <content:encoded><![CDATA[<p>also check out <a
href="http://github.com/maca/arguments" rel="nofollow">http://github.com/maca/arguments</a> very cool</p> ]]></content:encoded> </item> <item><title>By: Alan Skorkin</title><link>http://www.skorks.com/2009/08/method-arguments-in-ruby/comment-page-1/#comment-2173</link> <dc:creator>Alan Skorkin</dc:creator> <pubDate>Thu, 20 Aug 2009 13:03:07 +0000</pubDate> <guid
isPermaLink="false">http://www.skorks.com/?p=1043#comment-2173</guid> <description>I&#039;ve heard it referred to as a sponge operator before as well :).
That one sounds like a really useful trick though, I wasn&#039;t aware you could do that, thanks for sharing it.</description> <content:encoded><![CDATA[<p>I&#8217;ve heard it referred to as a sponge operator before as well :).</p><p>That one sounds like a really useful trick though, I wasn&#8217;t aware you could do that, thanks for sharing it.</p> ]]></content:encoded> </item> <item><title>By: Tim</title><link>http://www.skorks.com/2009/08/method-arguments-in-ruby/comment-page-1/#comment-2165</link> <dc:creator>Tim</dc:creator> <pubDate>Thu, 20 Aug 2009 05:04:37 +0000</pubDate> <guid
isPermaLink="false">http://www.skorks.com/?p=1043#comment-2165</guid> <description>BTW, it&#039;s called the splat operator. It&#039;s also mighty handy in certain metaprogramming situations, where you can use the reverse-splat operator to turn a list into an argument list.
i.e:
foo(a, b, c)
is equivalent to
foo(*[a, b, c])
allowing you to manipulate argument lists as arrays before sending them to some other function. It&#039;s amazing how useful this can be in practice.</description> <content:encoded><![CDATA[<p>BTW, it&#8217;s called the splat operator. It&#8217;s also mighty handy in certain metaprogramming situations, where you can use the reverse-splat operator to turn a list into an argument list.<br
/> i.e:<br
/> foo(a, b, c)<br
/> is equivalent to<br
/> foo(*[a, b, c])</p><p>allowing you to manipulate argument lists as arrays before sending them to some other function. It&#8217;s amazing how useful this can be in practice.</p> ]]></content:encoded> </item> </channel> </rss>
