but, unfortunately, most apis seem to return Arrays! one noticable exception
is guy’s plruby (procedural ruby for postgres) which does use hashes.
however, i’ve heard that Hashes require much more overhead than array’s, and
they also do not preserve ordering so in general i prefer Array’s for db code.
when i must map into a hash-like structure i use an RBTree so i can at least
define/enforce an ordering…
more than you wanted to know, i’m sure
-a
···
On Tue, 3 Jun 2003, Hal E. Fulton wrote:
relation.select(:field0, :field1){|tuple| tuple[:field0, :field1] === [/foo/, /bar/]}
i actually have something which does the above using named fields in
arrays.
it’s very cool but slower than dirt
Named fields?
Did you consider a hash (or better a Struct)?
–
Ara Howard
NOAA Forecast Systems Laboratory
Information and Technology Services
Data Systems Group
R/FST 325 Broadway
Boulder, CO 80305-3328
Email: ara.t.howard@noaa.gov
Phone: 303-497-7238
Fax: 303-497-7259
~ > ruby -e ‘p % ^) .intern’
====================================