--tgO4DUqb0GCKXXLG Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable (For those keeping track at home of my Ruby vs. Ruby/C vs. C++ adventures, I decided to go with pure Ruby and optimise afterwards if/where needed and my supervisor agreed. I also started coding yesterday, and would like to state that (a) Ruby test-driven development is even more sexy than advertised and (b) humblelittlerubybook.com is a really great book.) On to my problem, then. :) First, the terminology: a block is a set of vectors (say, integers), a blanket is a set of blocks, and a blanket might be, but in most cases isn, encoded i.e., might have its blocks named. Thus an example, unencoded two-block blanket might look like this: {{1, 9, 4, 7}, {1, 9, 3, 7}} My obvious first approach was to create a Block class with two properties, a @vectors Set and an @encoding Symbol, and a Blanket class with a @blocks Set. Now that I think about it, though, most of the computing will happen with unencoded blankets, and in this case there¡Çs no need for a Block class at all; just a Blanket with a Set of Sets. First, this (I presume) would make things a bit faster and less memory hungry; second, the encoding makes sense only at the Blanket level, really. Ufortunately, an encoded blanket screams to be represented as a Hash of Sets (keyed with the encoding Symbols), while an unencoded blanket is best represented as a Set of Sets, and can¡Çt be a Hash. What would be the best approach to this situation? An EncodedBlanket subclass of Blanket? A Blanket class that is a Hash of Symbols keyed with Sets (i.e., the other way around, with nil hash values for unencoded blankets)? Something else? Basically, what I need is a hash that doesn¡Çt have to have keys¡Ä -- Shot -- Can't you feel the peace and contentment in this block of code? Ruby is the language Buddha would have programmed in. -- Sean Russell --tgO4DUqb0GCKXXLG Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQFFtypji/mCfdEo8UoRAu1wAKCaflIbvGee7dDRh8uqhrCk1fOXcwCeIbs4 r2zh1UFwXIHGEywH5hZSOH8 vL -----END PGP SIGNATURE----- --tgO4DUqb0GCKXXLG--