My pal, Peter, put out a pretty sweet tutorial recently: http://www.xaop.com/articles/2007/10/07/metaprogramming Prepare to shit your SQL pants! T.
on 2007-11-05 03:21
on 2007-11-05 09:08
Very interesting, and it's from the Belgian Ruby User Group. Didn't even know there was one! Are you suggesting Og could use a result = query do ... ? (ab) Trans schreef: > Nitro-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- Arne Brasseur http://www.arnebrasseur.net http://www.zhongwiki.com http://www.bankske.org arne@arnebrasseur.net
on 2007-11-05 10:05
Yes, very interesting. But don't we already have stuff like that in Og? (the Caboose::EZ module). /lasso
on 2007-11-05 17:20
On Nov 5, 3:38 am, "Lars Olsson" <la...@lassoweb.se> wrote: > Yes, very interesting. But don't we already have stuff like that in Og? > (the Caboose::EZ module). I wouldn't know. I find zero docs for it. T.
on 2007-11-05 17:38
On 11/4/07, Trans <transfire@gmail.com> wrote: > My pal, Peter, put out a pretty sweet tutorial recently: > > http://www.xaop.com/articles/2007/10/07/metaprogramming > > Prepare to shit your SQL pants! It's a simplified version of Kansas. Been doing this for years. Kirk Haines
on 2007-11-05 17:47
On Nov 5, 10:14 am, "Kirk Haines" <wyhai...@gmail.com> wrote: > On 11/4/07, Trans <transf...@gmail.com> wrote: > > > My pal, Peter, put out a pretty sweet tutorial recently: > > > http://www.xaop.com/articles/2007/10/07/metaprogramming > > > Prepare to shit your SQL pants! > > It's a simplified version of Kansas. Been doing this for years. Kansas has a DSL like that? T.
on 2007-11-05 18:05
On 11/5/07, Trans <transfire@gmail.com> wrote:
> Kansas has a DSL like that?
Yeah. It's central to why I like Kansas. And that code _really_
looks like it's just a simplified reimplementation of some Kansas
code. I like some of the changes to the syntax in his example,
though.
students = ksdbh.select(:Students)
male_students = ksdbh.select(:Students) {|s| s.gender == 'm'}
males_ordered_by_gpa_between_27_and_40 = ksdbh.select(:Students) do |s|
s.order_by(:gpa)
(s.gender == 'm') & (s.age.between(27,40))
end
I've had a Kansas rewrite on my todo list for a very long time. I am
taking a closer look at some of his syntax ideas. I like a couple of
them.
Kirk Haines