From: Trans Date: 2008-10-07T23:31:43+09:00 Subject: Re: RINQ? On Oct 7, 5:11 am, Peña, Botp wrote: > From: Trans [mailto:transf...@gmail.com] > #... > #   r = query do > #         from :c => :customer, :a => :account, :b => :bank > #         select b.name > #         where (( c.firstname == first1 ) | > #                ( c.firstname == first2 ) ) & > #               ( c.lastname =~ last ) & > #               ( a.owner == c ) & > #               ( a.bank == b ) > #   end > > try > >    r = query(customer, account, bank)  do |c,a,b| >          select (( c.firstname == first1 ) | >                 ( c.firstname == first2 ) ) & >                 ( c.lastname =~ last ) & >                 ( a.owner == c ) & >                 ( a.bank == b ) . >          collect b.name >        end Ah, I see. Ok, then even a little more Rubyish: r = select(customer, account, bank) do |c,a,b| (( c.firstname == first1 ) || ( c.firstname == first2 )) && ( c.lastname =~ last ) && ( a.owner == c ) && ( a.bank == b ) end. collect(customer){ |b| b.name } > #... > # But is Ruby ultimately expressive enough? We > # may end up adding enough new syntax > > i think ruby syntax is more than enough (imho). In a way, i'd like to think like active records when it comes to databases (in mfowler's sense, not rails) and use ruby to implem. How does Fowler's approach differ from Rails? I didn't know there was an essential distinction. T.