From: khaines@... Date: 2006-12-06T09:45:57+09:00 Subject: Re: Lisp comprehensions => SQL On Wed, 6 Dec 2006, Victor "Zverok" Shepelev wrote: A lot of these things are either supported in Kansas, or are in the drawing board for when I can get back to Kansas development. > employees = Table.new(:id, :name, :sec_name, :salary, :age) > > employees.select{|e| e.name == 'John' && e.salary > 50}.sort_by{|e| > e.age}[2,10] Current Kansas: dbh.select(:Employees) do |e| sort_by(e.age) limit(2,10) (e.name == 'John') & (e.salary > 50) end Future Kansas: employees = Kansas::DBNAME::Employees employees.select do |e| sort_by(e.age) limit(2,10) (e.name == 'John') & (e.salary > 50) end > employees.select{|e| e.salary < 150}.count Current: dbh.count(:Employees) {|e| e.salary < 150} Future: employees.count {|e| e.salary < 150} > employees = Table.new(:id, :name, :sec_name, :salary, :age) > positions = Table.new(:id, :employee_id, :position_name) > > (employees + positions).select{|e, p| e.id == p.employee_id} Current: dbh.select(:Employees, :Positions) {|e,p| e.id == p.employee_id} I have not worked on Kansas much in the last year because it is stable for me, but there are a number of things that I have planned when I can set aside some time to get back around to it. Kirk Haines