Jaw drops... > Your wish is my small patch.
I seem to have stumbled onto a new programming paradigm. I partially think through half baked design concepts then Iain not only throughly cooks my ideas he writes all the code. This is called Extreme Spoon Programming (xSp) - look for my upcoming book on this revolutionary technique. > > I wonder if an optimization of this would be to internally > > create two separate specrefs with the same regex but one > > with a length of 4 and one with a length of 5? > > The optimization is to just create the one parser from the > spec ref and assign it into the lengths hash. As it's a > reference, it's lighter than making a separate parser > coderef for each array. But it's just the way one would > write it anyway rather than being explicitly optimized. Awww, of course - I didn't really think it through. > > The overhead of this may not be worth it - too bad we > > don't have compiled code. > > I was briefly contemplating having it so that Builder (or, > rather, an API clone of Builder with almost completely > different innards) would produce actual code that one could > save, thus eliminating the need for the average user to have > Builder installed. That sounds almost like writing a compiler that emits perl code... :) > But it proved too much for my tortured brain. I think the > current situation works well enough. Mine too. But maybe Simon would say it's cool. > Now try writing tests. Uhhh - I'll move my ISO8601 code to the new features. :) -J --
