<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>pinds.com &#187; programming</title>
	<atom:link href="http://pinds.com/tag/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://pinds.com</link>
	<description>spiritual entrepreneurship, personal growth, internet, food, politics.</description>
	<lastBuildDate>Thu, 02 Feb 2012 19:09:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Spot the difference</title>
		<link>http://pinds.com/2008/11/05/spot-the-difference/</link>
		<comments>http://pinds.com/2008/11/05/spot-the-difference/#comments</comments>
		<pubDate>Wed, 05 Nov 2008 21:41:00 +0000</pubDate>
		<dc:creator>Lars Pind</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://pinds.com/2008/11/05/spot-the-difference</guid>
		<description><![CDATA[This does what you&#8217;d expect: %w(msgtype state chstat chstatmsg qpstat qpstatmsg merchant merchantemail cardtype).each do &#124;attr&#124; define_method(attr) do params[attr] end end This does not: for attr in %w(msgtype state chstat chstatmsg qpstat qpstatmsg merchant merchantemail cardtype) define_method(attr) do params[attr] end end The latter version uses the last value for attr (in this case, cardtype) for [...]]]></description>
			<content:encoded><![CDATA[<p>This does what you&#8217;d expect:</p>
<pre><code>%w(msgtype state chstat chstatmsg qpstat qpstatmsg merchant merchantemail cardtype).each do |attr|
  define_method(attr) do
    params[attr]
  end
end</code></pre>
<p>This does not:</p>
<pre><code>for attr in %w(msgtype state chstat chstatmsg qpstat qpstatmsg merchant merchantemail cardtype)
  define_method(attr) do
    params[attr]
  end
end</code></pre>
<p>The latter version uses the last value for attr (in this case, cardtype) for each method it defines.</p>
<p>I thought for x in y was just syntactilcal sugar. Apparently not. You live, you learn :)</p>
]]></content:encoded>
			<wfw:commentRss>http://pinds.com/2008/11/05/spot-the-difference/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced

Served from: pinds.com @ 2012-02-03 18:07:14 -->
