Kirk Haines wrote:
> On Friday 19 August 2005 9:14 am, Jamey Cribbs wrote:
>
> > Ok, here is a somewhat simplified code example.  Let's say you have a
> > table that holds information about WWII airplanes.  You want to write a
> > query that selects all planes from the table that belonged to the US and
> > had a top speed greater than 350mph.  First you would write the query,
> > using a block to specify the actual select condition:
> >
> > results = plane_tbl.select { |r| r.country == 'USA' and r.speed > 350 }
>
> I *heart* that sort of query syntax.  You'll see much the same thing in the
> Kansas ORM:
>
> results = ksdbh.select(:Planes) {|r| (r.country == 'USA') & (r.speed > 350)}

Good ole Smalltalk :-)

'select' even wormed it's way into OCL v1.1 (p16)
http://www.google.com/url?sa=t&ct=res&cd=1&url=http%3A//umlcenter.visual-paradigm.com/umlresources/obje_11.pdf&ei=LxwGQ72PBpyQsQGAqO2qDQ


> In this case, method_missing magic is mixed into that in such a way that the
> Ruby code becomes a SQL statement for querying a relational database.
>
> It's a great way of interacting with data.  Neat to see that KirbyBase is
> doing that.
> 
> 
> Kirk Haines