
"Hartmut Kaiser" <hartmutkaiser@t-online.de> wrote in message news:1CAMfg-25Uvzt0@afwd00.sul.t-online.com...
Jonathan Turkanis wrote:
I see the library as the inverse of Spirit. Spirit takes a linear text and builds complex objects, while the output formatting library takes complex objects and renders them as linear text. Just as an abstract syntax tree does not preserve all the information in the input text, in many cases it will be desirable to loose information when an object is formatted using the present library. For example, sometime you might want a dog to be formatted as follows
I 100% agree with that. Moreover I have a first experimental implementation of such a library here, which is able to do formatted output controlled by a structure, which is very much similar to the Spirit grammar DSL. BTW, the name of this library is Tirips (reversed Spirit) :-).
For instance you could write:
generate(str("abc") << char('d'), someoutputiter);
Which will simply output "abcd". The different generator objects are parametrizable with lazy constructs:
<snip examples>
I'm currently at the early stages of such a library so there isn't very much code to show, but if anybody is interested I'm happy to collaborate on discussing and implementing this.
I'm definitely interested. Jonathan