From: khaines@... Date: 2006-12-06T20:31:51+09:00 Subject: Re: Lisp comprehensions => SQL On Wed, 6 Dec 2006, Victor "Zverok" Shepelev wrote: > Trying to read this: > > dbh.select(:Employees) do |e| > sort_by(e.age) > limit(2,10) > (e.name == 'John') & (e.salary > 50) > end > > cause a bunch of questions from Ruby perspective. I "can't understand" > (intuitively, I mean) "what would be sorted", "what would be limited", > "where condition applies". How about this: employees.select do |e| ((e.name == 'John') & (e.salary > 50)).sort_by(e.age)[2..10] end I like that syntax, personally. Kirk Haines