Skip to content

Commit

Permalink
"Improve" the article with extra words.
Browse files Browse the repository at this point in the history
  • Loading branch information
stevejwriter committed Apr 25, 2010
1 parent e3edf74 commit f3ed0c6
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions _posts/2009-12-13-higher-order-select-in-ruby.textile
@@ -1,9 +1,10 @@
---
layout: post
location: San Francisco
title: Higher Order Select in Ruby
---

h1. Higher Order Select in Ruby
h1. {{ page.title }}

When I was converting my blog to jekyll, I had to write a nested
select in Ruby and found it to be a little painful.
Expand All @@ -25,10 +26,21 @@ end

{% endhighlight %}

In scala, things are a little simpler thanks to anaphora: the ability

p. In Scala, things are a little simpler thanks to anaphora: the ability
to easily reference earlier state implicitly. That's what the _ means
in this context.


{% highlight scala %}
feed.entries.filter(!_.categories.filter(_.term == "http://schemas.google.com/blogger/2008/kind#post").isEmpty)
{% endhighlight %}


p. Imagine the following sentence in English: "Steve used Steve's keys to
start Steve's car". Most programming languages insist on that level of
verbosity.


p. Raganwald has a nice "piece":http://github.com/raganwald/homoiconic/blob/master/2009-09-22/anaphora.md#readme exploring Anaphora in Ruby.

0 comments on commit f3ed0c6

Please sign in to comment.