<?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 for I'm Probably Corey</title>
	<atom:link href="http://probablycorey.wordpress.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://probablycorey.wordpress.com</link>
	<description></description>
	<pubDate>Fri, 25 Jul 2008 07:49:11 +0000</pubDate>
	<generator>http://wordpress.org/?v=MU</generator>
		<item>
		<title>Comment on POW! by elliottcable</title>
		<link>http://probablycorey.wordpress.com/2008/04/26/pow/#comment-51</link>
		<dc:creator>elliottcable</dc:creator>
		<pubDate>Tue, 17 Jun 2008 02:07:13 +0000</pubDate>
		<guid isPermaLink="false">http://probablycorey.wordpress.com/?p=13#comment-51</guid>
		<description>Ack, just noticed you already have something similar in place!

Also, you might wanna let commenters use that sexy code-box you have set up. My comment looks fuuuugly on my end.</description>
		<content:encoded><![CDATA[<p>Ack, just noticed you already have something similar in place!</p>
<p>Also, you might wanna let commenters use that sexy code-box you have set up. My comment looks fuuuugly on my end.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on POW! by elliottcable</title>
		<link>http://probablycorey.wordpress.com/2008/04/26/pow/#comment-50</link>
		<dc:creator>elliottcable</dc:creator>
		<pubDate>Tue, 17 Jun 2008 02:06:23 +0000</pubDate>
		<guid isPermaLink="false">http://probablycorey.wordpress.com/?p=13#comment-50</guid>
		<description>As stolen from &lt;a href="http://github.com/elliottcable/git-blog/tree/master/lib/git-blog/core_ext/file.rb" rel="nofollow"&gt;various&lt;/a&gt; &lt;a href="http://github.com/elliottcable/rdie/tree/master/lib/core_ext/symbol.rb" rel="nofollow"&gt;of my&lt;/a&gt; &lt;a href="http://github.com/elliottcable/reve/tree/master/lib/reve/core_ext/file.rb" rel="nofollow"&gt;projects&lt;/a&gt;. Feel free to hack some out of it, should simplify your argument structs.

&lt;code&gt;
class File
  module Pathize
    def / other
      File.join(self.to_s, other.to_s)
    end
  end
  
  Extensions = %r=^(markdown&#124;textile&#124;haml&#124;sass&#124;css&#124;html&#124;xhtml&#124;rb&#124;txt&#124;text&#124;atom&#124;rss&#124;xml)$=i
  module Extension
    def method_missing(meth, *args)
      if Extensions =~ meth.to_s
        [self, '.', meth.to_s].join
      else
        super
      end
    end
  end
end

class String
  include File::Extension
  include File::Pathize
end
class Symbol
  include File::Extension
  include File::Pathize
end
&lt;/code&gt;

Then you should be able to do...

&lt;code&gt;
Pow(:tmp / :sub_dir / :file.txt) do &#124;file&#124;
  # All the stuff you usually do with an open file!
  file.read 
end
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>As stolen from <a href="http://github.com/elliottcable/git-blog/tree/master/lib/git-blog/core_ext/file.rb" rel="nofollow">various</a> <a href="http://github.com/elliottcable/rdie/tree/master/lib/core_ext/symbol.rb" rel="nofollow">of my</a> <a href="http://github.com/elliottcable/reve/tree/master/lib/reve/core_ext/file.rb" rel="nofollow">projects</a>. Feel free to hack some out of it, should simplify your argument structs.</p>
<p><code><br />
class File<br />
  module Pathize<br />
    def / other<br />
      File.join(self.to_s, other.to_s)<br />
    end<br />
  end</p>
<p>  Extensions = %r=^(markdown|textile|haml|sass|css|html|xhtml|rb|txt|text|atom|rss|xml)$=i<br />
  module Extension<br />
    def method_missing(meth, *args)<br />
      if Extensions =~ meth.to_s<br />
        [self, '.', meth.to_s].join<br />
      else<br />
        super<br />
      end<br />
    end<br />
  end<br />
end</p>
<p>class String<br />
  include File::Extension<br />
  include File::Pathize<br />
end<br />
class Symbol<br />
  include File::Extension<br />
  include File::Pathize<br />
end<br />
</code></p>
<p>Then you should be able to do&#8230;</p>
<p><code><br />
Pow(:tmp / :sub_dir / :file.txt) do |file|<br />
  # All the stuff you usually do with an open file!<br />
  file.read<br />
end<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on POW! by Nome do Jogo &#187; Artigo &#187; Rails Podcast Brasil - Episódio 15</title>
		<link>http://probablycorey.wordpress.com/2008/04/26/pow/#comment-45</link>
		<dc:creator>Nome do Jogo &#187; Artigo &#187; Rails Podcast Brasil - Episódio 15</dc:creator>
		<pubDate>Fri, 02 May 2008 14:48:45 +0000</pubDate>
		<guid isPermaLink="false">http://probablycorey.wordpress.com/?p=13#comment-45</guid>
		<description>[...] POW! [...]</description>
		<content:encoded><![CDATA[<p>[...] POW! [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Abusing Ruby&#8217;s question mark methods. by Tiago Albineli Motta</title>
		<link>http://probablycorey.wordpress.com/2008/03/28/abusing-rubys-question-mark-methods/#comment-43</link>
		<dc:creator>Tiago Albineli Motta</dc:creator>
		<pubDate>Tue, 15 Apr 2008 17:12:50 +0000</pubDate>
		<guid isPermaLink="false">http://probablycorey.wordpress.com/?p=10#comment-43</guid>
		<description>Very funny :)</description>
		<content:encoded><![CDATA[<p>Very funny :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Abusing Ruby&#8217;s question mark methods. by Rails Podcast Brasil - Episódio 12</title>
		<link>http://probablycorey.wordpress.com/2008/03/28/abusing-rubys-question-mark-methods/#comment-36</link>
		<dc:creator>Rails Podcast Brasil - Episódio 12</dc:creator>
		<pubDate>Mon, 07 Apr 2008 13:30:51 +0000</pubDate>
		<guid isPermaLink="false">http://probablycorey.wordpress.com/?p=10#comment-36</guid>
		<description>[...] Abusing Ruby’s question mark methods. [...]</description>
		<content:encoded><![CDATA[<p>[...] Abusing Ruby’s question mark methods. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Abusing Ruby&#8217;s question mark methods. by Mr eel</title>
		<link>http://probablycorey.wordpress.com/2008/03/28/abusing-rubys-question-mark-methods/#comment-31</link>
		<dc:creator>Mr eel</dc:creator>
		<pubDate>Tue, 01 Apr 2008 12:51:34 +0000</pubDate>
		<guid isPermaLink="false">http://probablycorey.wordpress.com/?p=10#comment-31</guid>
		<description>I suggest just writing not_*? methods and mixing them into the appropriate classes.

Metaprogramming trix are nice, but this more complicated than it needs to be IMO.</description>
		<content:encoded><![CDATA[<p>I suggest just writing not_*? methods and mixing them into the appropriate classes.</p>
<p>Metaprogramming trix are nice, but this more complicated than it needs to be IMO.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Abusing Ruby&#8217;s question mark methods. by Robin</title>
		<link>http://probablycorey.wordpress.com/2008/03/28/abusing-rubys-question-mark-methods/#comment-30</link>
		<dc:creator>Robin</dc:creator>
		<pubDate>Tue, 01 Apr 2008 12:00:15 +0000</pubDate>
		<guid isPermaLink="false">http://probablycorey.wordpress.com/?p=10#comment-30</guid>
		<description>Oh sweet, sweet syntactic sugar... beautiful stuff! This will certainly go into my library of little ruby tidbits that I use for all my projects in some shape or form. Thanks for sharing the idea with us!</description>
		<content:encoded><![CDATA[<p>Oh sweet, sweet syntactic sugar&#8230; beautiful stuff! This will certainly go into my library of little ruby tidbits that I use for all my projects in some shape or form. Thanks for sharing the idea with us!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Abusing Ruby&#8217;s question mark methods. by Emmanuel Oga</title>
		<link>http://probablycorey.wordpress.com/2008/03/28/abusing-rubys-question-mark-methods/#comment-29</link>
		<dc:creator>Emmanuel Oga</dc:creator>
		<pubDate>Tue, 01 Apr 2008 02:22:45 +0000</pubDate>
		<guid isPermaLink="false">http://probablycorey.wordpress.com/?p=10#comment-29</guid>
		<description>I like a similar trick but using non_* and only_* methods... This could be done using a proxy object like yours (a cleaner implementation?) This is how I use it:

{{{
Enumerable.class_eval do
 alias_method :original_method_missing, :method_missing

 def method_missing(symbol, *args)
   if symbol.to_s =~ /(non&#124;only)_(.*)/
     prefix, question = Regexp.last_match[1], Regexp.last_match[2]

     operation = (prefix == "non") ? "reject" : "select"

     self.class.class_eval(&#60;&#60;-NEW_METHOD, __FILE__, __LINE__)
       def #{ symbol }
         #{ operation } { &#124;obj&#124; obj.#{ question }? }
       end
     NEW_METHOD

     send(symbol)
   else
     original_method_missing(symbol, *args)
   end
 end
end

Numeric.class_eval do
  def even?
    (self % 2) == 0
  end
end

puts (1..10).only_even # 2, 4, 6, 8, 10
}}}</description>
		<content:encoded><![CDATA[<p>I like a similar trick but using non_* and only_* methods&#8230; This could be done using a proxy object like yours (a cleaner implementation?) This is how I use it:</p>
<p>{{{<br />
Enumerable.class_eval do<br />
 alias_method :original_method_missing, :method_missing</p>
<p> def method_missing(symbol, *args)<br />
   if symbol.to_s =~ /(non|only)_(.*)/<br />
     prefix, question = Regexp.last_match[1], Regexp.last_match[2]</p>
<p>     operation = (prefix == &#8220;non&#8221;) ? &#8220;reject&#8221; : &#8220;select&#8221;</p>
<p>     self.class.class_eval(&lt;&lt;-NEW_METHOD, __FILE__, __LINE__)<br />
       def #{ symbol }<br />
         #{ operation } { |obj| obj.#{ question }? }<br />
       end<br />
     NEW_METHOD</p>
<p>     send(symbol)<br />
   else<br />
     original_method_missing(symbol, *args)<br />
   end<br />
 end<br />
end</p>
<p>Numeric.class_eval do<br />
  def even?<br />
    (self % 2) == 0<br />
  end<br />
end</p>
<p>puts (1..10).only_even # 2, 4, 6, 8, 10<br />
}}}</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Abusing Ruby&#8217;s question mark methods. by trans</title>
		<link>http://probablycorey.wordpress.com/2008/03/28/abusing-rubys-question-mark-methods/#comment-28</link>
		<dc:creator>trans</dc:creator>
		<pubDate>Mon, 31 Mar 2008 21:19:39 +0000</pubDate>
		<guid isPermaLink="false">http://probablycorey.wordpress.com/?p=10#comment-28</guid>
		<description>Facets Functor class is desinged for these types of structures. It is the Higher Order Message pattern.

 class Object  
   def not  
     Functor.new do &#124;op, *args&#124;
       !__send__(op,*args)
     end
   end  
 end  

Add @_not &#124;&#124;= Functor.new ... to optimize.

Probably that it's a keyword doesn't matter b/c it will always be used in a fluent (dot) notation.</description>
		<content:encoded><![CDATA[<p>Facets Functor class is desinged for these types of structures. It is the Higher Order Message pattern.</p>
<p> class Object<br />
   def not<br />
     Functor.new do |op, *args|<br />
       !__send__(op,*args)<br />
     end<br />
   end<br />
 end  </p>
<p>Add @_not ||= Functor.new &#8230; to optimize.</p>
<p>Probably that it&#8217;s a keyword doesn&#8217;t matter b/c it will always be used in a fluent (dot) notation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Abusing Ruby&#8217;s question mark methods. by coderrr</title>
		<link>http://probablycorey.wordpress.com/2008/03/28/abusing-rubys-question-mark-methods/#comment-27</link>
		<dc:creator>coderrr</dc:creator>
		<pubDate>Mon, 31 Mar 2008 14:17:10 +0000</pubDate>
		<guid isPermaLink="false">http://probablycorey.wordpress.com/?p=10#comment-27</guid>
		<description>Cool!

This kinda reminds me of my either/both:
http://coderrr.wordpress.com/2008/03/10/either-or-both-a-cool-way-to-simplify-conditionals/

You could even chain them! :P

@Levi, using a bridge (proxy) object as he did is a way better (safer) approach than overwriting method_missing on Object.</description>
		<content:encoded><![CDATA[<p>Cool!</p>
<p>This kinda reminds me of my either/both:<br />
<a href="http://coderrr.wordpress.com/2008/03/10/either-or-both-a-cool-way-to-simplify-conditionals/" rel="nofollow">http://coderrr.wordpress.com/2008/03/10/either-or-both-a-cool-way-to-simplify-conditionals/</a></p>
<p>You could even chain them! :P</p>
<p>@Levi, using a bridge (proxy) object as he did is a way better (safer) approach than overwriting method_missing on Object.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
