<?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: 3 Ruby Quirks You Have to Love</title>
	<atom:link href="http://www.engineyard.com/blog/2009/3-ruby-quirks-you-have-to-love/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.engineyard.com/blog/2009/3-ruby-quirks-you-have-to-love/</link>
	<description></description>
	<lastBuildDate>Wed, 08 Feb 2012 05:24:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Matt</title>
		<link>http://www.engineyard.com/blog/2009/3-ruby-quirks-you-have-to-love/comment-page-1/#comment-31854</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Thu, 22 Oct 2009 01:41:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.engineyard.com/blog/?p=2559#comment-31854</guid>
		<description>I like to use heredoc identifiers nearly consistent with Ruby itself, with a little meta data tacked on: 
 
eval &lt;&lt;-&quot;end;&quot; 
  def #{name} 
    # magic 
  end 
end; 
 
Or: 
 
eval &lt;&lt;-&quot;end:accessor&quot; 
  # same as above 
end:accessor 
 
In some text editors, it can make syntax highlighting still work. </description>
		<content:encoded><![CDATA[<p>I like to use heredoc identifiers nearly consistent with Ruby itself, with a little meta data tacked on:</p>
<p>eval &lt;&lt;-&quot;end;&quot;</p>
<p>  def #{name}</p>
<p>    # magic</p>
<p>  end</p>
<p>end;</p>
<p>Or:</p>
<p>eval &lt;&lt;-&quot;end:accessor&quot;</p>
<p>  # same as above</p>
<p>end:accessor</p>
<p>In some text editors, it can make syntax highlighting still work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam Rawlins</title>
		<link>http://www.engineyard.com/blog/2009/3-ruby-quirks-you-have-to-love/comment-page-1/#comment-28794</link>
		<dc:creator>Sam Rawlins</dc:creator>
		<pubDate>Sat, 17 Oct 2009 22:28:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.engineyard.com/blog/?p=2559#comment-28794</guid>
		<description>I like your nested heredocs example. I think we can think of better examples when we consider that heredocs are typically used to generate a string of many, many lines, and if the nested feature is meant for assignment: 
 
article = &lt;&lt;ARTICLE 
#{author=&lt;&lt;AUTHOR}Sam RawlinsAUTHOR 
#{date=&lt;&lt;DATE}October 17, 2009DATE 
#{content=&lt;&lt;CONTENT}Text text text 
Content here. Content content. 
More lines and lines.CONTENT 
ARTICLE    # =&gt; &quot;... 
 
This basically is ERB though... embedding ruby code in special symbols (#{} above, &lt;% %&gt; in ERB), and everything outside special symbols is string. </description>
		<content:encoded><![CDATA[<p>I like your nested heredocs example. I think we can think of better examples when we consider that heredocs are typically used to generate a string of many, many lines, and if the nested feature is meant for assignment: </p>
<p>article = &lt;&lt;ARTICLE<br />
#{author=&lt;&lt;AUTHOR}Sam RawlinsAUTHOR<br />
#{date=&lt;&lt;DATE}October 17, 2009DATE<br />
#{content=&lt;&lt;CONTENT}Text text text<br />
Content here. Content content.<br />
More lines and lines.CONTENT<br />
ARTICLE    # =&gt; &quot;&#8230; </p>
<p>This basically is ERB though&#8230; embedding ruby code in special symbols (#{} above, &lt;% %&gt; in ERB), and everything outside special symbols is string.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: enebo</title>
		<link>http://www.engineyard.com/blog/2009/3-ruby-quirks-you-have-to-love/comment-page-1/#comment-28119</link>
		<dc:creator>enebo</dc:creator>
		<pubDate>Fri, 16 Oct 2009 15:35:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.engineyard.com/blog/?p=2559#comment-28119</guid>
		<description>heh...I am not sure if it is my font size, but that snippet makes my eyes blur a little. :)   Single and double quotes right next to each other never look quite right to me.  I just tried: 
 
a = %q{&quot;double&quot;} %Q{&#039;single&#039;} expecting the feature to work and it broke! 
 
Still I can see why you are doing it and it is making me think this feature is used a little more than I thought. </description>
		<content:encoded><![CDATA[<p>heh&#8230;I am not sure if it is my font size, but that snippet makes my eyes blur a little. :)   Single and double quotes right next to each other never look quite right to me.  I just tried: </p>
<p>a = %q{&quot;double&quot;} %Q{&#039;single&#039;} expecting the feature to work and it broke! </p>
<p>Still I can see why you are doing it and it is making me think this feature is used a little more than I thought.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: enebo</title>
		<link>http://www.engineyard.com/blog/2009/3-ruby-quirks-you-have-to-love/comment-page-1/#comment-28117</link>
		<dc:creator>enebo</dc:creator>
		<pubDate>Fri, 16 Oct 2009 15:27:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.engineyard.com/blog/?p=2559#comment-28117</guid>
		<description>Yeah I knew you could continue lines with backslash and spaced it out when I was writing this.  It definitely makes the feature a tiny bit more useful.  I am still thinking I like heredocs a bit better in cases for perhaps all but two-line cases? </description>
		<content:encoded><![CDATA[<p>Yeah I knew you could continue lines with backslash and spaced it out when I was writing this.  It definitely makes the feature a tiny bit more useful.  I am still thinking I like heredocs a bit better in cases for perhaps all but two-line cases?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: priteau</title>
		<link>http://www.engineyard.com/blog/2009/3-ruby-quirks-you-have-to-love/comment-page-1/#comment-27944</link>
		<dc:creator>priteau</dc:creator>
		<pubDate>Fri, 16 Oct 2009 10:04:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.engineyard.com/blog/?p=2559#comment-27944</guid>
		<description>It&#039;s useful to cleverly concatenate the results of preprocessor macros... but also handy when you want to wrap your code at 80 columns. </description>
		<content:encoded><![CDATA[<p>It&#039;s useful to cleverly concatenate the results of preprocessor macros&#8230; but also handy when you want to wrap your code at 80 columns.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Geoff</title>
		<link>http://www.engineyard.com/blog/2009/3-ruby-quirks-you-have-to-love/comment-page-1/#comment-27831</link>
		<dc:creator>Geoff</dc:creator>
		<pubDate>Fri, 16 Oct 2009 06:16:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.engineyard.com/blog/?p=2559#comment-27831</guid>
		<description>I mostly find it useful when mixing single and double quoted strings: 
 
&lt;pre&gt; 
  a= &#039;&quot;double&quot;&#039;   &quot;&#039;single&#039;&quot; 
&lt;/pre&gt; </description>
		<content:encoded><![CDATA[<p>I mostly find it useful when mixing single and double quoted strings: </p>
<p>&lt;pre&gt;<br />
  a= &#039;&quot;double&quot;&#039;   &quot;&#039;single&#039;&quot;<br />
&lt;/pre&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jedediah</title>
		<link>http://www.engineyard.com/blog/2009/3-ruby-quirks-you-have-to-love/comment-page-1/#comment-27660</link>
		<dc:creator>jedediah</dc:creator>
		<pubDate>Thu, 15 Oct 2009 22:54:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.engineyard.com/blog/?p=2559#comment-27660</guid>
		<description>and apparently it breaks intensedebate 
 
pretend there are backslashes after &quot;foo&quot; and &quot;bar&quot; </description>
		<content:encoded><![CDATA[<p>and apparently it breaks intensedebate</p>
<p>pretend there are backslashes after &quot;foo&quot; and &quot;bar&quot;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jedediah</title>
		<link>http://www.engineyard.com/blog/2009/3-ruby-quirks-you-have-to-love/comment-page-1/#comment-27658</link>
		<dc:creator>jedediah</dc:creator>
		<pubDate>Thu, 15 Oct 2009 22:53:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.engineyard.com/blog/?p=2559#comment-27658</guid>
		<description>Backslash continues lines in Ruby: 
 
&quot;foo&quot;  
&quot;bar&quot;  
&quot;baz&quot; 
=&gt; &quot;foobarbaz&quot; </description>
		<content:encoded><![CDATA[<p>Backslash continues lines in Ruby:</p>
<p>&quot;foo&quot; </p>
<p>&quot;bar&quot; </p>
<p>&quot;baz&quot;</p>
<p>=&gt; &quot;foobarbaz&quot;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: djwonk</title>
		<link>http://www.engineyard.com/blog/2009/3-ruby-quirks-you-have-to-love/comment-page-1/#comment-27656</link>
		<dc:creator>djwonk</dc:creator>
		<pubDate>Thu, 15 Oct 2009 22:49:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.engineyard.com/blog/?p=2559#comment-27656</guid>
		<description>Ah, the joys of default values for method parameters! This reminds me of a nokogiri example: 
 
def at path, ns = document.root ? document.root.namespaces : {} 
  search(path, ns).first 
end 
 
Yeah, you can use the ternary operator as a default value for a parameter. If you want. And you leave out the parenthesis too. Easily readable? Not to me. 
 </description>
		<content:encoded><![CDATA[<p>Ah, the joys of default values for method parameters! This reminds me of a nokogiri example: </p>
<p>def at path, ns = document.root ? document.root.namespaces : {}<br />
  search(path, ns).first<br />
end </p>
<p>Yeah, you can use the ternary operator as a default value for a parameter. If you want. And you leave out the parenthesis too. Easily readable? Not to me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: enebo</title>
		<link>http://www.engineyard.com/blog/2009/3-ruby-quirks-you-have-to-love/comment-page-1/#comment-27651</link>
		<dc:creator>enebo</dc:creator>
		<pubDate>Thu, 15 Oct 2009 22:38:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.engineyard.com/blog/?p=2559#comment-27651</guid>
		<description>As a reply to your last sentence I am not sure I follow what you are asking?  You don&#039;t think that everything being an expression allows executable code in class bodies ... or you don&#039;t see being able to do this as an advantage?  </description>
		<content:encoded><![CDATA[<p>As a reply to your last sentence I am not sure I follow what you are asking?  You don&#039;t think that everything being an expression allows executable code in class bodies &#8230; or you don&#039;t see being able to do this as an advantage?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

