From: Dean M. B. <mik...@gm...> - 2008-10-20 04:51:12
|
Hi Kim, On Sun, Oct 19, 2008 at 4:14 PM, Kim Gräsman <kim...@gm...> wrote: > Hello, > > I'm looking at the URI processing again, and I don't really see the > benefit of the Fusion map. Is Fusion required by the Spirit parser? Or > just the easiest way to export the parser results? > Actually, there's something here that's not terribly obvious. One thing that isn't there yet (that ought to be) is the normalization of values in the fusion map, using fusion algorithms, that get unrolled at compile time by any compiler. ;) So instead of doing a run-time loop for compile-time unrollable loops (for example, lower-casing any protocols, making sure domain names are lower-cased, URL-encoding parameters, etc.) we get the efficiency with a nice and expressive yet succinct syntax. > If it's possible to extract the parser matches to regular variables, I > figure a couple of regular data members would be simpler. > That's the naive approach, which although may work, will lead to a lot of problems later once we add more parts of the URI that need to be processed similar to the other parts (lower-casing, widening/shortening, URL-encoding, etc.). > Is there any benefit of the Fusion map that I don't see? Perhaps the above explanation (with lack code sample still) can help. HTH -- Dean Michael C. Berris Software Engineer, Friendster, Inc. |