<?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: Ruby, Python, and references to functions&#8230;</title>
	<atom:link href="http://www.elfsternberg.com/2008/06/08/ruby-python-and-references-to-functions/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.elfsternberg.com/2008/06/08/ruby-python-and-references-to-functions/</link>
	<description>Done, and gets things smart.</description>
	<lastBuildDate>Fri, 03 Feb 2012 14:39:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: dstar</title>
		<link>http://www.elfsternberg.com/2008/06/08/ruby-python-and-references-to-functions/comment-page-1/#comment-16</link>
		<dc:creator>dstar</dc:creator>
		<pubDate>Mon, 09 Jun 2008 00:39:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.elfsternberg.com/?p=10#comment-16</guid>
		<description>The reference to e.g. foo()? Object#send takes a Symbol or a String; you don&#039;t have to do anything special.

I&#039;m not sure I&#039;m answering the right question, though, as I don&#039;t really understand the python code. Are blocks maybe a better answer to what you&#039;re looking for?

def bar (baz, &amp;quux)
  puts baz
  yeild baz
end

bar(&quot;Weeble&quot;) { &#124;wobble&#124; puts &quot;#{wobble} falls down&quot;}

=&gt; &quot;Weeble\nWeeble falls down\n&quot;</description>
		<content:encoded><![CDATA[<p>The reference to e.g. foo()? Object#send takes a Symbol or a String; you don&#8217;t have to do anything special.</p>
<p>I&#8217;m not sure I&#8217;m answering the right question, though, as I don&#8217;t really understand the python code. Are blocks maybe a better answer to what you&#8217;re looking for?</p>
<p>def bar (baz, &amp;quux)<br />
  puts baz<br />
  yeild baz<br />
end</p>
<p>bar(&#8220;Weeble&#8221;) { |wobble| puts &#8220;#{wobble} falls down&#8221;}</p>
<p>=&gt; &#8220;Weeble\nWeeble falls down\n&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elf Sternberg</title>
		<link>http://www.elfsternberg.com/2008/06/08/ruby-python-and-references-to-functions/comment-page-1/#comment-15</link>
		<dc:creator>Elf Sternberg</dc:creator>
		<pubDate>Sun, 08 Jun 2008 21:55:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.elfsternberg.com/?p=10#comment-15</guid>
		<description>To some extent, but I&#039;d also like to know how to do it in within the current namespace, as you can with nested functions within a method in Python, and it&#039;s the case statement&#039;s power.  You&#039;ve described the &lt;i&gt;invocation&lt;/i&gt;, which is fine; how do I get the &lt;i&gt;reference&lt;/i&gt;?

I think that Ruby&#039;s &quot;You don&#039;t need parentheses to trigger a method&quot; has poisoned Ruby&#039;s headaround.</description>
		<content:encoded><![CDATA[<p>To some extent, but I&#8217;d also like to know how to do it in within the current namespace, as you can with nested functions within a method in Python, and it&#8217;s the case statement&#8217;s power.  You&#8217;ve described the <i>invocation</i>, which is fine; how do I get the <i>reference</i>?</p>
<p>I think that Ruby&#8217;s &#8220;You don&#8217;t need parentheses to trigger a method&#8221; has poisoned Ruby&#8217;s headaround.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dstar</title>
		<link>http://www.elfsternberg.com/2008/06/08/ruby-python-and-references-to-functions/comment-page-1/#comment-14</link>
		<dc:creator>dstar</dc:creator>
		<pubDate>Sun, 08 Jun 2008 20:54:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.elfsternberg.com/?p=10#comment-14</guid>
		<description>Are you looking for something like 
class MyClass
  def foo
  end
  def bar
  end
  def baz
  end
  def whichparam(parameter)
  if param=&#039;quux&#039;
    return self.send(:foo,parameter)
  .....
  end
...</description>
		<content:encoded><![CDATA[<p>Are you looking for something like<br />
class MyClass<br />
  def foo<br />
  end<br />
  def bar<br />
  end<br />
  def baz<br />
  end<br />
  def whichparam(parameter)<br />
  if param=&#8217;quux&#8217;<br />
    return self.send(:foo,parameter)<br />
  &#8230;..<br />
  end<br />
&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

