<?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: Mind blowing Ruby</title>
	<atom:link href="http://matthewbass.com/2007/02/03/mind-blowing-ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://matthewbass.com/2007/02/03/mind-blowing-ruby/</link>
	<description>Musings on software and life...</description>
	<lastBuildDate>Sun, 11 Jul 2010 16:07:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: links for 2007-02-05 &#171; Werner Ramaekers</title>
		<link>http://matthewbass.com/2007/02/03/mind-blowing-ruby/comment-page-1/#comment-1925</link>
		<dc:creator>links for 2007-02-05 &#171; Werner Ramaekers</dc:creator>
		<pubDate>Mon, 05 Feb 2007 10:18:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.matthewbass.com/blog/2007/02/03/mind-blowing-ruby/#comment-1925</guid>
		<description>[...] Mind blowing Ruby (Pelargir - Musings on software and life from Matthew Bass. ) Ruby is a fantastic tool. But it’s not just a tool, it’s also an art medium. (tags: programming ruby classes constants) [...]</description>
		<content:encoded><![CDATA[<p>[...] Mind blowing Ruby (Pelargir &#8211; Musings on software and life from Matthew Bass. ) Ruby is a fantastic tool. But it’s not just a tool, it’s also an art medium. (tags: programming ruby classes constants) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthew Bass</title>
		<link>http://matthewbass.com/2007/02/03/mind-blowing-ruby/comment-page-1/#comment-1923</link>
		<dc:creator>Matthew Bass</dc:creator>
		<pubDate>Sun, 04 Feb 2007 17:40:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.matthewbass.com/blog/2007/02/03/mind-blowing-ruby/#comment-1923</guid>
		<description>Thanks for the code samples, Stevan. The Perl sample is especially interesting.

I didn&#039;t mean to imply that statically typed languages can&#039;t support iterators with shortened syntax. I was simply using the phrase &quot;statically typed&quot; to refer to the group of languages I had been taught in college. Sorry if I wasn&#039;t clear.</description>
		<content:encoded><![CDATA[<p>Thanks for the code samples, Stevan. The Perl sample is especially interesting.</p>
<p>I didn&#8217;t mean to imply that statically typed languages can&#8217;t support iterators with shortened syntax. I was simply using the phrase &#8220;statically typed&#8221; to refer to the group of languages I had been taught in college. Sorry if I wasn&#8217;t clear.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stevan</title>
		<link>http://matthewbass.com/2007/02/03/mind-blowing-ruby/comment-page-1/#comment-1922</link>
		<dc:creator>Stevan</dc:creator>
		<pubDate>Sun, 04 Feb 2007 14:23:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.matthewbass.com/blog/2007/02/03/mind-blowing-ruby/#comment-1922</guid>
		<description>&lt;blockquote&gt;&lt;i&gt;
I’ve never been much of a fan of Perl. I’m guessing something similar can be done there. 
&lt;/i&gt;&lt;/blockquote&gt;

You can do this in Perl pretty easily, like so:
&lt;code&gt;
my @animals = (&#039;dog&#039;, &#039;cat&#039;, &#039;bird&#039;);
print join &quot; &quot; =&gt; @animals;
# or
map { print $_, &quot; &quot; } @animals;
print grep { /do/ } @animals
&lt;/code&gt;

&lt;blockquote&gt;&lt;i&gt;
But for me, a young developer fresh out of college, the ability to iterate (not to mention define an array or a hash) in a single line of code was a big draw away from my world of statically typed languages. 
&lt;/i&gt;&lt;/blockquote&gt;

Being statically typed has nothing to do with it, languages like Haskell, Standard ML and OCaml are just as statically typed as Java/C# (and without all those tedious type annotations all over the place too). And you can do just the same one liners as in Ruby, here is an example in OCaml:
&lt;code&gt;
let animals = [ &quot;dog&quot;; &quot;cat&quot;; &quot;bird&quot; ] in
List.iter (fun a -&gt; print_string(a ^ &quot; &quot;)) animals;
print_string (List.filter (fun a -&gt; Str.string_match (Str.regexp_string &quot;do&quot;) a 0) animals);
&lt;/code&gt;
The regexp code is a little messier because it does not have the syntactic sugar that Ruby and Perl do for them, but this is essentially the same thing and it is statically typed.


- Stevan
</description>
		<content:encoded><![CDATA[<blockquote><p><i><br />
I’ve never been much of a fan of Perl. I’m guessing something similar can be done there.<br />
</i></p></blockquote>
<p>You can do this in Perl pretty easily, like so:<br />
<code><br />
my @animals = ('dog', 'cat', 'bird');<br />
print join " " =&gt; @animals;<br />
# or<br />
map { print $_, " " } @animals;<br />
print grep { /do/ } @animals<br />
</code></p>
<blockquote><p><i><br />
But for me, a young developer fresh out of college, the ability to iterate (not to mention define an array or a hash) in a single line of code was a big draw away from my world of statically typed languages.<br />
</i></p></blockquote>
<p>Being statically typed has nothing to do with it, languages like Haskell, Standard ML and OCaml are just as statically typed as Java/C# (and without all those tedious type annotations all over the place too). And you can do just the same one liners as in Ruby, here is an example in OCaml:<br />
<code><br />
let animals = [ "dog"; "cat"; "bird" ] in<br />
List.iter (fun a -&gt; print_string(a ^ " ")) animals;<br />
print_string (List.filter (fun a -&gt; Str.string_match (Str.regexp_string "do") a 0) animals);<br />
</code><br />
The regexp code is a little messier because it does not have the syntactic sugar that Ruby and Perl do for them, but this is essentially the same thing and it is statically typed.</p>
<p>- Stevan</p>
]]></content:encoded>
	</item>
</channel>
</rss>
