John Maddock wrote:
> I've been experimenting with templates and macros over lunch (well what else
> does a guy do?)
Haha!
> and it's not really working as required just yet, given:
>
> [def __alpha '''α''']
> [template super(text) '''<superscript>'''text'''</superscript>''' ]
> [template pow(a, b) a'''<superscript>'''b'''</superscript>''' ]
>
> Then:
>
> x super(2)
>
> Puts a space between the x and the superscript-2
I see. And there is no way to juxtapose x and super
without the space. This, I guess, is another case for
the new proposed syntax:
x[super 2]
[...]
> It's not just super/sub scripts either: try to define a macro or template to
> expand out unit's of epsilon and the space gets even more obvious, there's
> no way at present to write out 2eps using the right symbol for "eps" except
> by doing the whole thing in XML. Since the digit obviously varies from
> usage to usage, that's not nice! Try and write out an equation
> "2-alpha-beta-squared" and you'd pretty rapidly give up, before it gets any
> more complex.
>
> Some of this appears to be due to XML escapes always being pretty-printed on
> a new line, so
>
> pow(x, 2) comes out as:
>
> x
> <superscript>
> 2
> </superscript>
>
> Which is where at least some of the spaces come from.
>
> So.... I'm hoping that this can be solved by changing the pretty-printing
> code, but I have suspicions that the problems may run deeper.
Quite probably. I can take a look sometime tonight and see how it
goes. Thanks for your experiments! That will help me get things
straightened up. I'm sure we'll find a good nice solution.
Regards,
--
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net
_______________________________________________
Boost-docs mailing list
[email protected]
Unsubscribe and other administrative requests:
https://lists.sourceforge.net/lists/listinfo/boost-docs