<?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>X-Combinator &#187; erlang</title>
	<atom:link href="http://www.xcombinator.com/category/erlang/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.xcombinator.com</link>
	<description>making the human scalable</description>
	<lastBuildDate>Thu, 09 Sep 2010 03:46:53 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>rough cut: erlang code coverage with rake</title>
		<link>http://www.xcombinator.com/2009/08/05/rough-cut-erlang-code-coverage-with-rake/</link>
		<comments>http://www.xcombinator.com/2009/08/05/rough-cut-erlang-code-coverage-with-rake/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 16:32:13 +0000</pubDate>
		<dc:creator>Nate Murray</dc:creator>
				<category><![CDATA[erlang]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.xcombinator.com/2009/08/05/rough-cut-erlang-code-coverage-with-rake/</guid>
		<description><![CDATA[Here&#8217;s a quick, ugly version of how to get erlang code coverage using rake. This is a rough first draft and the gist below doesn&#8217;t include all the needed dependencies. To see the rest of the Rakefile, checkout skelerl.

Share:
	
	
	
	
	
	
	
	
	

]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick, ugly version of how to get erlang code coverage using rake. This is a rough first draft and the gist below doesn&#8217;t include all the needed dependencies. To see the rest of the Rakefile, checkout <a href="http://github.com/jashmenn/skelerl/blob/b4f64f6ab9ddf3e444aab2e5f2342ac056459469/tasks/build.rake">skelerl</a>.</p>
<p><script src="http://gist.github.com/162794.js"></script></p>
<p>Share:</p>
<p>	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F08%2F05%2Frough-cut-erlang-code-coverage-with-rake%2F&amp;title=rough%20cut%3A%20erlang%20code%20coverage%20with%20rake&amp;notes=Here%27s%20a%20quick%2C%20ugly%20version%20of%20how%20to%20get%20erlang%20code%20coverage%20using%20rake.%20This%20is%20a%20rough%20first%20draft%20and%20the%20gist%20below%20doesn%27t%20include%20all%20the%20needed%20dependencies.%20To%20see%20the%20rest%20of%20the%20Rakefile%2C%20checkout%20skelerl.%0D%0A%0D%0A" title="del.icio.us"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F08%2F05%2Frough-cut-erlang-code-coverage-with-rake%2F&amp;title=rough%20cut%3A%20erlang%20code%20coverage%20with%20rake" title="Reddit"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F08%2F05%2Frough-cut-erlang-code-coverage-with-rake%2F" title="Technorati"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://twitter.com/home?status=rough%20cut%3A%20erlang%20code%20coverage%20with%20rake%20-%20http%3A%2F%2Fwww.xcombinator.com%2F2009%2F08%2F05%2Frough-cut-erlang-code-coverage-with-rake%2F" title="Twitter"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F08%2F05%2Frough-cut-erlang-code-coverage-with-rake%2F&amp;t=rough%20cut%3A%20erlang%20code%20coverage%20with%20rake" title="Facebook"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F08%2F05%2Frough-cut-erlang-code-coverage-with-rake%2F&amp;title=rough%20cut%3A%20erlang%20code%20coverage%20with%20rake&amp;annotation=Here%27s%20a%20quick%2C%20ugly%20version%20of%20how%20to%20get%20erlang%20code%20coverage%20using%20rake.%20This%20is%20a%20rough%20first%20draft%20and%20the%20gist%20below%20doesn%27t%20include%20all%20the%20needed%20dependencies.%20To%20see%20the%20rest%20of%20the%20Rakefile%2C%20checkout%20skelerl.%0D%0A%0D%0A" title="Google Bookmarks"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F08%2F05%2Frough-cut-erlang-code-coverage-with-rake%2F&amp;t=rough%20cut%3A%20erlang%20code%20coverage%20with%20rake" title="HackerNews"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F08%2F05%2Frough-cut-erlang-code-coverage-with-rake%2F&amp;partner=sociable" title="PDF"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/pdf.png" title="PDF" alt="PDF" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.xcombinator.com/feed/" title="RSS"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xcombinator.com/2009/08/05/rough-cut-erlang-code-coverage-with-rake/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby&#8217;s #each_with_index for Erlang</title>
		<link>http://www.xcombinator.com/2009/02/10/rubys-each_with_index-for-erlang/</link>
		<comments>http://www.xcombinator.com/2009/02/10/rubys-each_with_index-for-erlang/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 19:30:49 +0000</pubDate>
		<dc:creator>Nate Murray</dc:creator>
				<category><![CDATA[erlang]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.xcombinator.com/2009/02/10/rubys-each_with_index-for-erlang/</guid>
		<description><![CDATA[
Ruby has a great method for enumerations called #each_with_index. It&#8217;s a handy way to iterate over a list of elements and and know where you&#8217;re at while doing it.

Erlang has a group of highly optimized list operations in the lists module (Try erl -man lists to see them all). We&#8217;re going to be using those [...]]]></description>
			<content:encoded><![CDATA[<p>
Ruby has a great method for enumerations called <tt>#each_with_index</tt>. It&#8217;s a handy way to iterate over a list of elements and and know where you&#8217;re at while doing it.</p>
<p>
Erlang has a group of highly optimized list operations in the <tt>lists</tt> module (Try <tt>erl -man lists</tt> to see them all). We&#8217;re going to be using those to build our Erlang version of <tt>#each_with_index</tt>.
</p>
<p>
There are two methods from <tt>list</tt> we&#8217;re going to use: <tt>lists:seq</tt> and <tt>lists:zip</tt>. <tt>lists:seq</tt> simply returns a list of integers between a given range. For instance:</p>

<div class="wp_syntax"><div class="code"><pre class="erlang" style="font-family:monospace;"><span style="color: #ff9600;">1</span><span style="color: #014ea4;">&gt;</span> <span style="color: #45b3e6;">Seq</span> <span style="color: #014ea4;">=</span> <span style="color: #ff4e18;">lists</span>:<span style="color: #ff3c00;">seq</span><span style="color: #109ab8;">&#40;</span><span style="color: #ff9600;">0</span><span style="color: #6bb810;">,</span> <span style="color: #ff9600;">9</span><span style="color: #109ab8;">&#41;</span><span style="color: #6bb810;">.</span>
<span style="color: #109ab8;">&#91;</span><span style="color: #ff9600;">0</span><span style="color: #6bb810;">,</span><span style="color: #ff9600;">1</span><span style="color: #6bb810;">,</span><span style="color: #ff9600;">2</span><span style="color: #6bb810;">,</span><span style="color: #ff9600;">3</span><span style="color: #6bb810;">,</span><span style="color: #ff9600;">4</span><span style="color: #6bb810;">,</span><span style="color: #ff9600;">5</span><span style="color: #6bb810;">,</span><span style="color: #ff9600;">6</span><span style="color: #6bb810;">,</span><span style="color: #ff9600;">7</span><span style="color: #6bb810;">,</span><span style="color: #ff9600;">8</span><span style="color: #6bb810;">,</span><span style="color: #ff9600;">9</span><span style="color: #109ab8;">&#93;</span></pre></div></div>

<p><tt>lists:zip</tt> takes two lists (of equal length) and returns a list of tuples. Like so:</p>

<div class="wp_syntax"><div class="code"><pre class="erlang" style="font-family:monospace;"><span style="color: #ff9600;">2</span><span style="color: #014ea4;">&gt;</span> <span style="color: #ff4e18;">lists</span>:<span style="color: #ff3c00;">zip</span><span style="color: #109ab8;">&#40;</span><span style="color: #109ab8;">&#91;</span>a<span style="color: #6bb810;">,</span>b<span style="color: #6bb810;">,</span>c<span style="color: #109ab8;">&#93;</span><span style="color: #6bb810;">,</span> <span style="color: #109ab8;">&#91;</span><span style="color: #ff9600;">1</span><span style="color: #6bb810;">,</span><span style="color: #ff9600;">2</span><span style="color: #6bb810;">,</span><span style="color: #ff9600;">3</span><span style="color: #109ab8;">&#93;</span><span style="color: #109ab8;">&#41;</span><span style="color: #6bb810;">.</span>
<span style="color: #109ab8;">&#91;</span><span style="color: #109ab8;">&#123;</span>a<span style="color: #6bb810;">,</span><span style="color: #ff9600;">1</span><span style="color: #109ab8;">&#125;</span><span style="color: #6bb810;">,</span><span style="color: #109ab8;">&#123;</span>b<span style="color: #6bb810;">,</span><span style="color: #ff9600;">2</span><span style="color: #109ab8;">&#125;</span><span style="color: #6bb810;">,</span><span style="color: #109ab8;">&#123;</span>c<span style="color: #6bb810;">,</span><span style="color: #ff9600;">3</span><span style="color: #109ab8;">&#125;</span><span style="color: #109ab8;">&#93;</span></pre></div></div>

<p>The last thing we need is a list comprehension, which is similar to <tt>each</tt> with a block in Ruby. For instance, in Ruby:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#006600; font-weight:bold;">&gt;&gt;</span> <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:a</span>, <span style="color:#ff3333; font-weight:bold;">:b</span>, <span style="color:#ff3333; font-weight:bold;">:c</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">each</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>element<span style="color:#006600; font-weight:bold;">|</span> <span style="color:#CC0066; font-weight:bold;">puts</span> element <span style="color:#006600; font-weight:bold;">&#125;</span>
a
b
c
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:a</span>, <span style="color:#ff3333; font-weight:bold;">:b</span>, <span style="color:#ff3333; font-weight:bold;">:c</span><span style="color:#006600; font-weight:bold;">&#93;</span></pre></div></div>

<p>In Erlang we would do the following:</p>

<div class="wp_syntax"><div class="code"><pre class="erlang" style="font-family:monospace;"><span style="color: #ff9600;">3</span><span style="color: #014ea4;">&gt;</span> <span style="color: #109ab8;">&#91;</span><span style="color: #ff4e18;">io</span>:<span style="color: #ff3c00;">format</span><span style="color: #109ab8;">&#40;</span><span style="color: #ff7800;">&quot;~p~n&quot;</span><span style="color: #6bb810;">,</span> <span style="color: #109ab8;">&#91;</span><span style="color: #45b3e6;">Element</span><span style="color: #109ab8;">&#93;</span><span style="color: #109ab8;">&#41;</span> <span style="color: #014ea4;">||</span> <span style="color: #45b3e6;">Element</span> <span style="color: #014ea4;">&lt;-</span> <span style="color: #109ab8;">&#91;</span>a<span style="color: #6bb810;">,</span>b<span style="color: #6bb810;">,</span>c<span style="color: #109ab8;">&#93;</span><span style="color: #109ab8;">&#93;</span><span style="color: #6bb810;">.</span>
a
b
c
<span style="color: #109ab8;">&#91;</span>ok<span style="color: #6bb810;">,</span>ok<span style="color: #6bb810;">,</span>ok<span style="color: #109ab8;">&#93;</span></pre></div></div>

<p>There is one difference here: the Erlang list comprehension returns a new list which is the value of each call to <tt>io:format</tt>. In this way an Erlang list comprehension is closer to Ruby&#8217;s <tt>#collect</tt> rather than <tt>#each</tt>.</p>
<p>
We now have all the pieces to build our Erlang version of <tt>#each_with_index</tt>.</p>

<div class="wp_syntax"><div class="code"><pre class="erlang" style="font-family:monospace;"><span style="color: #ff9600;">4</span><span style="color: #014ea4;">&gt;</span> <span style="color: #45b3e6;">EachWithIndex</span> <span style="color: #014ea4;">=</span> <span style="color: #ff3c00;">fun</span><span style="color: #109ab8;">&#40;</span><span style="color: #45b3e6;">L</span><span style="color: #6bb810;">,</span> <span style="color: #45b3e6;">X</span><span style="color: #109ab8;">&#41;</span> <span style="color: #6bb810;">-&gt;</span> <span style="color: #109ab8;">&#91;</span>
  <span style="color: #45b3e6;">X</span><span style="color: #109ab8;">&#40;</span><span style="color: #45b3e6;">Element</span><span style="color: #6bb810;">,</span> <span style="color: #45b3e6;">Index</span><span style="color: #109ab8;">&#41;</span> <span style="color: #014ea4;">||</span> 
  <span style="color: #109ab8;">&#123;</span><span style="color: #45b3e6;">Element</span><span style="color: #6bb810;">,</span> <span style="color: #45b3e6;">Index</span><span style="color: #109ab8;">&#125;</span> <span style="color: #014ea4;">&lt;-</span> <span style="color: #ff4e18;">lists</span>:<span style="color: #ff3c00;">zip</span><span style="color: #109ab8;">&#40;</span><span style="color: #45b3e6;">L</span><span style="color: #6bb810;">,</span> <span style="color: #ff4e18;">lists</span>:<span style="color: #ff3c00;">seq</span><span style="color: #109ab8;">&#40;</span><span style="color: #ff9600;">1</span><span style="color: #6bb810;">,</span> <span style="color: #ff3c00;">length</span><span style="color: #109ab8;">&#40;</span><span style="color: #45b3e6;">L</span><span style="color: #109ab8;">&#41;</span><span style="color: #109ab8;">&#41;</span><span style="color: #109ab8;">&#41;</span>
   <span style="color: #109ab8;">&#93;</span> <span style="color: #186895;">end</span><span style="color: #6bb810;">.</span></pre></div></div>

<p>Whats going on here?</p>

<div class="wp_syntax"><div class="code"><pre class="erlang" style="font-family:monospace;"><span style="color: #ff4e18;">lists</span>:<span style="color: #ff3c00;">zip</span><span style="color: #109ab8;">&#40;</span><span style="color: #45b3e6;">L</span><span style="color: #6bb810;">,</span> <span style="color: #ff4e18;">lists</span>:<span style="color: #ff3c00;">seq</span><span style="color: #109ab8;">&#40;</span><span style="color: #ff9600;">1</span><span style="color: #6bb810;">,</span> <span style="color: #ff3c00;">length</span><span style="color: #109ab8;">&#40;</span><span style="color: #45b3e6;">L</span><span style="color: #109ab8;">&#41;</span><span style="color: #109ab8;">&#41;</span><span style="color: #109ab8;">&#41;</span></pre></div></div>

<p>creates a list of tuples with each tuple containing an element of <tt>L</tt> and a companion integer.</p>

<div class="wp_syntax"><div class="code"><pre class="erlang" style="font-family:monospace;"><span style="color: #109ab8;">&#91;</span><span style="color: #45b3e6;">X</span><span style="color: #109ab8;">&#40;</span><span style="color: #45b3e6;">Element</span><span style="color: #6bb810;">,</span> <span style="color: #45b3e6;">Index</span><span style="color: #109ab8;">&#41;</span> <span style="color: #014ea4;">||</span> 
  <span style="color: #109ab8;">&#123;</span><span style="color: #45b3e6;">Element</span><span style="color: #6bb810;">,</span> <span style="color: #45b3e6;">Index</span><span style="color: #109ab8;">&#125;</span> <span style="color: #014ea4;">&lt;-</span> <span style="color: #ff4e18;">lists</span>:<span style="color: #ff3c00;">zip</span><span style="color: #109ab8;">&#40;</span><span style="color: #45b3e6;">L</span><span style="color: #6bb810;">,</span> <span style="color: #ff4e18;">lists</span>:<span style="color: #ff3c00;">seq</span><span style="color: #109ab8;">&#40;</span><span style="color: #ff9600;">1</span><span style="color: #6bb810;">,</span> <span style="color: #ff3c00;">length</span><span style="color: #109ab8;">&#40;</span><span style="color: #45b3e6;">L</span><span style="color: #109ab8;">&#41;</span><span style="color: #109ab8;">&#41;</span><span style="color: #109ab8;">&#41;</span><span style="color: #109ab8;">&#93;</span></pre></div></div>

<p>tells us to take that list of tuples and do a list comprehension on each of the elements, calling <tt>fun X</tt> in turn.</p>

<div class="wp_syntax"><div class="code"><pre class="erlang" style="font-family:monospace;"><span style="color: #45b3e6;">EachWithIndex</span> <span style="color: #014ea4;">=</span> <span style="color: #ff3c00;">fun</span><span style="color: #109ab8;">&#40;</span><span style="color: #45b3e6;">L</span><span style="color: #6bb810;">,</span> <span style="color: #45b3e6;">X</span><span style="color: #109ab8;">&#41;</span> <span style="color: #6bb810;">-&gt;</span> <span style="color: #6bb810;">...</span> <span style="color: #186895;">end</span><span style="color: #6bb810;">.</span></pre></div></div>

<p>creates a <tt>fun</tt> (think <i>lambda</i>) and assigns it to <tt>EachWithIndex</tt>. You could just as easily create this as a regular function in a <tt>.erl</tt> file somewhere.
</p>
<p>
Now we can call our new <tt>EachWithIndex</tt> function by passing in a list and a <tt>fun</tt>:
</p>

<div class="wp_syntax"><div class="code"><pre class="erlang" style="font-family:monospace;"><span style="color: #ff9600;">5</span><span style="color: #014ea4;">&gt;</span> <span style="color: #45b3e6;">E</span><span style="color: #ff3c00;">achWithIndex</span><span style="color: #109ab8;">&#40;</span><span style="color: #109ab8;">&#91;</span>a<span style="color: #6bb810;">,</span>b<span style="color: #6bb810;">,</span>c<span style="color: #6bb810;">,</span>d<span style="color: #6bb810;">,</span>e<span style="color: #109ab8;">&#93;</span><span style="color: #6bb810;">,</span> <span style="color: #ff3c00;">fun</span><span style="color: #109ab8;">&#40;</span><span style="color: #45b3e6;">Element</span><span style="color: #6bb810;">,</span> <span style="color: #45b3e6;">Index</span><span style="color: #109ab8;">&#41;</span> <span style="color: #6bb810;">-&gt;</span> <span style="color: #ff4e18;">io</span>:<span style="color: #ff3c00;">format</span><span style="color: #109ab8;">&#40;</span><span style="color: #ff7800;">&quot;~p at ~p~n&quot;</span><span style="color: #6bb810;">,</span> <span style="color: #109ab8;">&#91;</span><span style="color: #45b3e6;">Element</span><span style="color: #6bb810;">,</span> <span style="color: #45b3e6;">Index</span><span style="color: #109ab8;">&#93;</span><span style="color: #109ab8;">&#41;</span> <span style="color: #186895;">end</span><span style="color: #109ab8;">&#41;</span><span style="color: #6bb810;">.</span>
a at <span style="color: #ff9600;">1</span>
b at <span style="color: #ff9600;">2</span>
c at <span style="color: #ff9600;">3</span>
d at <span style="color: #ff9600;">4</span>
e at <span style="color: #ff9600;">5</span>
<span style="color: #109ab8;">&#91;</span>ok<span style="color: #6bb810;">,</span>ok<span style="color: #6bb810;">,</span>ok<span style="color: #6bb810;">,</span>ok<span style="color: #6bb810;">,</span>ok<span style="color: #109ab8;">&#93;</span></pre></div></div>

<p>Share:</p>
<p>	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F02%2F10%2Frubys-each_with_index-for-erlang%2F&amp;title=Ruby%27s%20%3Ctt%3E%23each_with_index%3C%2Ftt%3E%20for%20Erlang&amp;notes=%0D%0ARuby%20has%20a%20great%20method%20for%20enumerations%20called%20%23each_with_index.%20It%27s%20a%20handy%20way%20to%20iterate%20over%20a%20list%20of%20elements%20and%20and%20know%20where%20you%27re%20at%20while%20doing%20it.%0D%0A%0D%0A%0D%0AErlang%20has%20a%20group%20of%20highly%20optimized%20list%20operations%20in%20the%20lists%20module%20%28Try%20" title="del.icio.us"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F02%2F10%2Frubys-each_with_index-for-erlang%2F&amp;title=Ruby%27s%20%3Ctt%3E%23each_with_index%3C%2Ftt%3E%20for%20Erlang" title="Reddit"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F02%2F10%2Frubys-each_with_index-for-erlang%2F" title="Technorati"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://twitter.com/home?status=Ruby%27s%20%3Ctt%3E%23each_with_index%3C%2Ftt%3E%20for%20Erlang%20-%20http%3A%2F%2Fwww.xcombinator.com%2F2009%2F02%2F10%2Frubys-each_with_index-for-erlang%2F" title="Twitter"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F02%2F10%2Frubys-each_with_index-for-erlang%2F&amp;t=Ruby%27s%20%3Ctt%3E%23each_with_index%3C%2Ftt%3E%20for%20Erlang" title="Facebook"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F02%2F10%2Frubys-each_with_index-for-erlang%2F&amp;title=Ruby%27s%20%3Ctt%3E%23each_with_index%3C%2Ftt%3E%20for%20Erlang&amp;annotation=%0D%0ARuby%20has%20a%20great%20method%20for%20enumerations%20called%20%23each_with_index.%20It%27s%20a%20handy%20way%20to%20iterate%20over%20a%20list%20of%20elements%20and%20and%20know%20where%20you%27re%20at%20while%20doing%20it.%0D%0A%0D%0A%0D%0AErlang%20has%20a%20group%20of%20highly%20optimized%20list%20operations%20in%20the%20lists%20module%20%28Try%20" title="Google Bookmarks"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F02%2F10%2Frubys-each_with_index-for-erlang%2F&amp;t=Ruby%27s%20%3Ctt%3E%23each_with_index%3C%2Ftt%3E%20for%20Erlang" title="HackerNews"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F02%2F10%2Frubys-each_with_index-for-erlang%2F&amp;partner=sociable" title="PDF"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/pdf.png" title="PDF" alt="PDF" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.xcombinator.com/feed/" title="RSS"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xcombinator.com/2009/02/10/rubys-each_with_index-for-erlang/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 1.403 seconds -->
