From: Matthew Moss Date: 2007-08-31T00:35:51+09:00 Subject: Re: [QUIZ] ID3 Tags (#136) On 8/30/07, Matthew Moss wrote: > On 8/29/07, James Edward Gray II wrote: > > On Aug 29, 2007, at 6:56 PM, Matthew Moss wrote: > > > > > I've been extremely busy lately, but I wanted to give this one a try. > > > This solution is not complete as far as the problem specification > > > goes, but my bit o' metaprogramming-type stuff works, though I'd have > > > liked to push it further. > > > > This is a very clever solution. I have one suggestion though� > > > > > class ID3 > > > > > > @@recLen = 0 > > > > > > def ID3.field(name, len, flags=[]) > > > > Changing flags=[] to *flags gives a nicer interface, I think. > > True... I had thought of that this morning, though I also wanted to > add a conversion parameter... so a lambda or block could be provided > that would convert between the record's string data and an integer > (e.g. the ID3 year). And, of course, the whole field/record thingy should be separated out into its own class/module/whatever. I did see bit-struct out there, and considered a solution using that, but it felt weird to be doing things at a bit-level, so I just kept on with my own.