<?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: I love &#8220;map by pluralisation&#8221; [now: map_by_method]</title>
	<atom:link href="http://drnicwilliams.com/2006/10/04/i-love-map-by-pluralisation/feed/" rel="self" type="application/rss+xml" />
	<link>http://drnicwilliams.com/2006/10/04/i-love-map-by-pluralisation/</link>
	<description>Ruby makes Rails, Javascript makes Ajax, Dr Nic makes Magic</description>
	<pubDate>Sun, 20 Jul 2008 11:31:25 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Dr Nic</title>
		<link>http://drnicwilliams.com/2006/10/04/i-love-map-by-pluralisation/#comment-34778</link>
		<dc:creator>Dr Nic</dc:creator>
		<pubDate>Fri, 29 Jun 2007 06:58:53 +0000</pubDate>
		<guid isPermaLink="false">http://drnicwilliams.com/2006/10/04/i-love-map-by-pluralisation/#comment-34778</guid>
		<description>@Mike - ahh, yes you will need to add &lt;code&gt;require 'rubygems'&lt;/code&gt; in your .irbrc file (and wherever else you want to access rubygems). Sorry I didn't get around to looking at this before you solved it. Thanks.</description>
		<content:encoded><![CDATA[<p>@Mike - ahh, yes you will need to add <code>require 'rubygems'</code> in your .irbrc file (and wherever else you want to access rubygems). Sorry I didn&#8217;t get around to looking at this before you solved it. Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike McKay</title>
		<link>http://drnicwilliams.com/2006/10/04/i-love-map-by-pluralisation/#comment-34776</link>
		<dc:creator>Mike McKay</dc:creator>
		<pubDate>Fri, 29 Jun 2007 06:55:07 +0000</pubDate>
		<guid isPermaLink="false">http://drnicwilliams.com/2006/10/04/i-love-map-by-pluralisation/#comment-34776</guid>
		<description>Solved it - I had to add:

require "rubygems" 

just before the 

require "map_by_method"

Strange that no one else has to do this...</description>
		<content:encoded><![CDATA[<p>Solved it - I had to add:</p>
<p>require &#8220;rubygems&#8221; </p>
<p>just before the </p>
<p>require &#8220;map_by_method&#8221;</p>
<p>Strange that no one else has to do this&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike McKay</title>
		<link>http://drnicwilliams.com/2006/10/04/i-love-map-by-pluralisation/#comment-34717</link>
		<dc:creator>Mike McKay</dc:creator>
		<pubDate>Thu, 28 Jun 2007 14:13:44 +0000</pubDate>
		<guid isPermaLink="false">http://drnicwilliams.com/2006/10/04/i-love-map-by-pluralisation/#comment-34717</guid>
		<description>I have a strange situation. If I do require "map_by_method" within my .irbrc file it doesn't work. But I run require "map_by_method" within irb or script console it works great. Any ideas why this would happen?

&lt;code&gt;
# cat /home/crazy/.irbrc 
ARGV.concat [ "--readline", "--prompt-mode", "simple" ]

require 'irb/completion'
require 'irb/ext/save-history'
require 'pp'

IRB.conf[:AUTO_INDENT]=true
IRB.conf[:SAVE_HISTORY] = 500
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history"

require 'map_by_method' # Can't get this to work

# script/console 
Loading development environment.
&#62;&#62; ["1","2"].collect_to_i
NoMethodError: undefined method `collect_to_i' for ["1", "2"]:Array
        from (irb):1
&#62;&#62; require 'map_by_method'
=&#62; true
&#62;&#62; ["1","2"].collect_to_i
=&#62; [1, 2]
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>I have a strange situation. If I do require &#8220;map_by_method&#8221; within my .irbrc file it doesn&#8217;t work. But I run require &#8220;map_by_method&#8221; within irb or script console it works great. Any ideas why this would happen?</p>
<p><code><br />
# cat /home/crazy/.irbrc<br />
ARGV.concat [ "--readline", "--prompt-mode", "simple" ]</p>
<p>require &#8216;irb/completion&#8217;<br />
require &#8216;irb/ext/save-history&#8217;<br />
require &#8216;pp&#8217;</p>
<p>IRB.conf[:AUTO_INDENT]=true<br />
IRB.conf[:SAVE_HISTORY] = 500<br />
IRB.conf[:HISTORY_FILE] = &#8220;#{ENV['HOME']}/.irb-save-history&#8221;</p>
<p>require &#8216;map_by_method&#8217; # Can&#8217;t get this to work</p>
<p># script/console<br />
Loading development environment.<br />
&gt;&gt; ["1","2"].collect_to_i<br />
NoMethodError: undefined method `collect_to_i&#8217; for ["1", "2"]:Array<br />
        from (irb):1<br />
&gt;&gt; require &#8216;map_by_method&#8217;<br />
=&gt; true<br />
&gt;&gt; ["1","2"].collect_to_i<br />
=&gt; [1, 2]<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: KDr2 &#187; 简单漂亮的打包GEM</title>
		<link>http://drnicwilliams.com/2006/10/04/i-love-map-by-pluralisation/#comment-2205</link>
		<dc:creator>KDr2 &#187; 简单漂亮的打包GEM</dc:creator>
		<pubDate>Fri, 05 Jan 2007 08:03:50 +0000</pubDate>
		<guid isPermaLink="false">http://drnicwilliams.com/2006/10/04/i-love-map-by-pluralisation/#comment-2205</guid>
		<description>[...] 1.目标: 把 Map by Method(曾经叫做 Map by Pluralisation) library 打包成gem。 查看我们将要打包的代码的相关链接:original and demo。 [...]</description>
		<content:encoded><![CDATA[<p>[...] 1.目标: 把 Map by Method(曾经叫做 Map by Pluralisation) library 打包成gem。 查看我们将要打包的代码的相关链接:original and demo。 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dr Nic &#187; map_by_method now increasingly more niftier-er.</title>
		<link>http://drnicwilliams.com/2006/10/04/i-love-map-by-pluralisation/#comment-477</link>
		<dc:creator>Dr Nic &#187; map_by_method now increasingly more niftier-er.</dc:creator>
		<pubDate>Thu, 26 Oct 2006 12:07:11 +0000</pubDate>
		<guid isPermaLink="false">http://drnicwilliams.com/2006/10/04/i-love-map-by-pluralisation/#comment-477</guid>
		<description>[...] Recap on map_by_method magic: [...]</description>
		<content:encoded><![CDATA[<p>[...] Recap on map_by_method magic: [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dr Nic &#187; My .irbrc for console/irb</title>
		<link>http://drnicwilliams.com/2006/10/04/i-love-map-by-pluralisation/#comment-371</link>
		<dc:creator>Dr Nic &#187; My .irbrc for console/irb</dc:creator>
		<pubDate>Thu, 12 Oct 2006 11:19:38 +0000</pubDate>
		<guid isPermaLink="false">http://drnicwilliams.com/2006/10/04/i-love-map-by-pluralisation/#comment-371</guid>
		<description>[...] See the original and demo articles. [...]</description>
		<content:encoded><![CDATA[<p>[...] See the original and demo articles. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dr Nic on Ruby on Rails &#187; [ANN] Generating new gems for graceful goodliness</title>
		<link>http://drnicwilliams.com/2006/10/04/i-love-map-by-pluralisation/#comment-355</link>
		<dc:creator>Dr Nic on Ruby on Rails &#187; [ANN] Generating new gems for graceful goodliness</dc:creator>
		<pubDate>Wed, 11 Oct 2006 07:26:49 +0000</pubDate>
		<guid isPermaLink="false">http://drnicwilliams.com/2006/10/04/i-love-map-by-pluralisation/#comment-355</guid>
		<description>[...] See original and demo articles. Sex on a stick - soon to be gemified before your very eyes. (Download instructions for the prebuilt gem) [...]</description>
		<content:encoded><![CDATA[<p>[...] See original and demo articles. Sex on a stick - soon to be gemified before your very eyes. (Download instructions for the prebuilt gem) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dr Nic</title>
		<link>http://drnicwilliams.com/2006/10/04/i-love-map-by-pluralisation/#comment-314</link>
		<dc:creator>Dr Nic</dc:creator>
		<pubDate>Sat, 07 Oct 2006 07:55:03 +0000</pubDate>
		<guid isPermaLink="false">http://drnicwilliams.com/2006/10/04/i-love-map-by-pluralisation/#comment-314</guid>
		<description>@SonOfLilit - I like that idea as a fix for readability. I'll still keep select_overdrawn? as something that works because in the console I can be just that lazy, but for maintainability/re-readability I like select_by_xxx, map_by_yyy, etc. 

@greg - would select_by_xxx? solve the readability issues for you?

@lninyo - django/python could certainly implement this as python has a method_missing mechanism as well, but I haven't looked at Django beyond intro pages and the Snakes vs Rubies video.</description>
		<content:encoded><![CDATA[<p>@SonOfLilit - I like that idea as a fix for readability. I&#8217;ll still keep select_overdrawn? as something that works because in the console I can be just that lazy, but for maintainability/re-readability I like select_by_xxx, map_by_yyy, etc. </p>
<p>@greg - would select_by_xxx? solve the readability issues for you?</p>
<p>@lninyo - django/python could certainly implement this as python has a method_missing mechanism as well, but I haven&#8217;t looked at Django beyond intro pages and the Snakes vs Rubies video.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lninyo</title>
		<link>http://drnicwilliams.com/2006/10/04/i-love-map-by-pluralisation/#comment-313</link>
		<dc:creator>lninyo</dc:creator>
		<pubDate>Fri, 06 Oct 2006 22:17:10 +0000</pubDate>
		<guid isPermaLink="false">http://drnicwilliams.com/2006/10/04/i-love-map-by-pluralisation/#comment-313</guid>
		<description>That is awesome! (and a bit reminiscent of Django) am I correct? I remember seeing something like this when I was checking out django some time ago.</description>
		<content:encoded><![CDATA[<p>That is awesome! (and a bit reminiscent of Django) am I correct? I remember seeing something like this when I was checking out django some time ago.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Spurrier</title>
		<link>http://drnicwilliams.com/2006/10/04/i-love-map-by-pluralisation/#comment-311</link>
		<dc:creator>Greg Spurrier</dc:creator>
		<pubDate>Thu, 05 Oct 2006 16:50:46 +0000</pubDate>
		<guid isPermaLink="false">http://drnicwilliams.com/2006/10/04/i-love-map-by-pluralisation/#comment-311</guid>
		<description>Dr. Nic,

What I was thinking was that you'd take into account which iterators take blocks that are expected to be predicates and then append a '?' to the end of the method name in your method_missing implementation before sending it to the object.

By convention, all predicates are supposed to have question marks at the end of their name.  Just embrace that convention and require it.  :)

So, you'd still have overdrawn? the predicate, but it'd be select_overdrawn the magical method.

BTW, yesterday I came across a something similar that you might enjoy reading: http://nat.truemesh.com/archives/000535.html

Greg</description>
		<content:encoded><![CDATA[<p>Dr. Nic,</p>
<p>What I was thinking was that you&#8217;d take into account which iterators take blocks that are expected to be predicates and then append a &#8216;?&#8217; to the end of the method name in your method_missing implementation before sending it to the object.</p>
<p>By convention, all predicates are supposed to have question marks at the end of their name.  Just embrace that convention and require it.  <img src='http://drnicwilliams.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So, you&#8217;d still have overdrawn? the predicate, but it&#8217;d be select_overdrawn the magical method.</p>
<p>BTW, yesterday I came across a something similar that you might enjoy reading: <a href="http://nat.truemesh.com/archives/000535.html" rel="nofollow">http://nat.truemesh.com/archives/000535.html</a></p>
<p>Greg</p>
]]></content:encoded>
	</item>
</channel>
</rss>
