From: Martin Hansen Date: 2010-04-17T18:27:40+09:00 Subject: Re: Writing a parser > And you chose ruby? Ruby isn't exactly known for speed. And I can > practically guarantee you that the syck parser will be faster for hashes > of strings than your parser (as it is currently written and several > minor iterations out). > > But no, what you described IS yaml, it is just a subset of yaml. You can > enforce the subset-ness if you feel like it, but I'm not a big fan of > static typing, so I don't recommend it. Yes, for I want to use Ruby to juggle the records - and then let's see about the speed :o). I know from Perl that there is a quite a difference between a home rolled parser and YAML-syck (I never saw any subset-ness features). Also, I am learning here. This OO thinking is very exotic ... > At the very least, you should look at StringScanner and a full rewrite, > drop the silly Record class entirely and build up proper hashes of > strings. And don't leave those dangling File objects everywhere. Read > the whole file or use the block form of file.open. I will gladly consider a rewrite - I am afraid that I find Robert's contribution confusing (am I unfair?). I read about StringScanner in the Cookbook IIRC, but I better explore further. Why is the Record class silly? M -- Posted via http://www.ruby-forum.com/.