From: joel de g. <dj...@gm...> - 2001-12-21 17:56:10
|
Hello, The implementation of Spirit's semantic expressions (Lambda, argument binding) plus Spirit's closures (true local variables) is a very potent mix that, upon further deliberation, can be applied to other applications once decoupled and made generic. Spirit's closures is a unique facility that is missing in all lambda libraries I have seen so far. AFAIK, there are no known C++ lambda/functional libraries in existence that can access the *true* closure of functions with local variables that exist in the hardware stack. True closures is a unique Spirit innovation. It is well known that binders in C++ are your *poor man's* closure in the sense that the bound arguments are stored as member variables and thus are not reentrant at all. Dan and the others have noted that there are many classes in Spirit that could be decoupled from the framework for reuse in different contexts. The chset and the symbol table, for example. I think the closure + semantic expressions are another sub-framework that might be useful in other applications. Martijn and Chris suggestion that the semantic expression sub-framework be used in another context outside Spirit got me thinking. It is indeed possible! The implementation of the binders (semantic expressions) leveraged the tricks techniques used by the original Spirit library (e.g. curiously recurring template pattern). It was not derived from any binder libraries although Spirit itself was influenced greatly by FC++. To be politically correct, it might be possible to decouple its front end from the binder engine such that one can leverage other libraries (e.g Lambda Lib). Considering the size of Lambda Lib. compared to semantic- expressions which is just one header + implementation file, I can keep the original implementation as the default engine. So, do you think this is something worth doing? I'll appreciate your comments a lot. --Joel _________________________________________ I dedicate Spirit to my dear daughter Kim http://www.mikokoro.net/kim.html _________________________________________ |