<?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: Metaprogramming with Darkie The Fridge</title>
	<atom:link href="http://involution.com/2006/07/12/metaprogramming-with-darkie-the-fridge/feed/" rel="self" type="application/rss+xml" />
	<link>http://involution.com/2006/07/12/metaprogramming-with-darkie-the-fridge/</link>
	<description>Tony Perrie's Weblog</description>
	<lastBuildDate>Sat, 17 Jul 2010 00:32:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Administrator</title>
		<link>http://involution.com/2006/07/12/metaprogramming-with-darkie-the-fridge/comment-page-1/#comment-1036</link>
		<dc:creator>Administrator</dc:creator>
		<pubDate>Wed, 12 Jul 2006 21:32:39 +0000</pubDate>
		<guid isPermaLink="false">http://involution.com/2006/07/12/metaprogramming-with-darkie-the-fridge/#comment-1036</guid>
		<description>Problem is, the collect has to return a proc or the assignment would yield nil.  Consider the following example.

&lt;pre&gt;&lt;code&gt;  m = &#039;mr_beastly_&#039;
  funarray = (1..50).collect { &#124;darkie_the_fridge&#124;  
    thefun = m + darkie_the_fridge.to_s + &quot;!&quot;
    gift_of_beard = &quot;Proc.new { &#124;cinnamocha&#124; puts cinnamocha * #{darkie_the_fridge} }&quot;
    eval %{ def #{thefun}(cinnamocha)
              #{gift_of_beard}.call(cinnamocha)
            end
          }
    eval(gift_of_beard)
  }
  mr_beastly_6!(&#039;byzantine ghoulish pillary&#039;)
  funarray[6].call(&#039;zingosphere &#039;)
  boogiebot = funarray[10]
  boogiebot[&#039;zazzle99 &#039;]&lt;/code&gt;&lt;/pre&gt;

Output is
&lt;pre&gt;&lt;code&gt;byzantine ghoulish pillarybyzantine ghoulish pillarybyzantine ghoulish pillarybyzantine ghoulish pillarybyzantine ghoulish pillarybyzantine ghoulish pillary
zingosphere zingosphere zingosphere zingosphere zingosphere zingosphere zingosphere 
zazzle99 zazzle99 zazzle99 zazzle99 zazzle99 zazzle99 zazzle99 zazzle99 zazzle99 zazzle99 zazzle99 &lt;/code&gt;&lt;/pre&gt;

Also, try out variations with irb.  
</description>
		<content:encoded><![CDATA[<p>Problem is, the collect has to return a proc or the assignment would yield nil.  Consider the following example.</p>
<pre><code>  m = 'mr_beastly_'
  funarray = (1..50).collect { |darkie_the_fridge|
    thefun = m + darkie_the_fridge.to_s + "!"
    gift_of_beard = &quot;Proc.new { |cinnamocha| puts cinnamocha * #{darkie_the_fridge} }&quot;
    eval %{ def #{thefun}(cinnamocha)
              #{gift_of_beard}.call(cinnamocha)
            end
          }
    eval(gift_of_beard)
  }
  mr_beastly_6!('byzantine ghoulish pillary')
  funarray[6].call('zingosphere ')
  boogiebot = funarray[10]
  boogiebot['zazzle99 ']</code></pre>
<p>Output is</p>
<pre><code>byzantine ghoulish pillarybyzantine ghoulish pillarybyzantine ghoulish pillarybyzantine ghoulish pillarybyzantine ghoulish pillarybyzantine ghoulish pillary
zingosphere zingosphere zingosphere zingosphere zingosphere zingosphere zingosphere
zazzle99 zazzle99 zazzle99 zazzle99 zazzle99 zazzle99 zazzle99 zazzle99 zazzle99 zazzle99 zazzle99 </code></pre>
<p>Also, try out variations with irb.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JTAxx</title>
		<link>http://involution.com/2006/07/12/metaprogramming-with-darkie-the-fridge/comment-page-1/#comment-1030</link>
		<dc:creator>JTAxx</dc:creator>
		<pubDate>Wed, 12 Jul 2006 19:11:02 +0000</pubDate>
		<guid isPermaLink="false">http://involution.com/2006/07/12/metaprogramming-with-darkie-the-fridge/#comment-1030</guid>
		<description>how would you call the function from the created array, like

a = (1..50).collect {...........}

then if you&#039;d call a[5] &#039;boogiebot&#039;, it would return the same output as mr_beastly_5! ?</description>
		<content:encoded><![CDATA[<p>how would you call the function from the created array, like</p>
<p>a = (1..50).collect {&#8230;&#8230;&#8230;..}</p>
<p>then if you&#8217;d call a[5] &#8216;boogiebot&#8217;, it would return the same output as mr_beastly_5! ?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
