Subject: Re: [Boost-docs] How best to abbreviate calls to Unicode symbols using Quickbook
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2010-09-07 13:30:18
> -----Original Message-----
> From: boost-docs-bounces_at_[hidden] [mailto:boost-docs-
> bounces_at_[hidden]] On Behalf Of Daniel James
> Sent: Tuesday, September 07, 2010 1:19 PM
> To: Discussion of Boost Documentation
> Subject: Re: [Boost-docs] How best to abbreviate calls to Unicode symbols
> On 7 September 2010 12:39, Paul A. Bristow <pbristow_at_[hidden]>
> > Using Unicode values is a bit 'write-only', so giving a symbol a name
> > seems good but
> > I've noted a mix of using Unicode symbols both as MACRO defs and as
> > templates, for example:
> > [def __ceilR '''⌉''']
> This is preferred: [def __ceilR \u2309].
> and as templates
> > [template Alpha'''Α'''] [/ ? Greek capital letter alpha] //
> > in html4_symbols. qbk
> Or: [template Alpha\u0391]
OK - \\u0391 is nicer (though it hides the hexness ;-)
(but at least you can't forget the x (and I wondered why I got a squiggle
for a space ;-)
And the Unicode tables are in hex, so that makes it easier.
> > But it seems more consistent to use templates for both?
> In my opinion, there's a semantic difference between square brackets -
> are structural (like tags in html), and things like escapes and macros -
> part of the text. But this is just my opinion, and not consistently
> > QuickBook docs say
> > "
> > The difference with macros are
> > * The explicit template expansion syntax. This is an advantage
> > because, now, we don't have to use obscure naming conventions like
> > double underscores (e.g. __alpha__) to avoid unwanted macro replacement.
> > * The template is expanded at the point where it is invoked. A
> > macro is expanded immediately at its point of declaration. This is
> > subtle and can cause a slight difference in behavior especially if you
> > refer to other macros and templates in the body.
> Not really relevant in this case.
> > My instinct is to use templates - though missing the closing ] has
> > caused me grief ;-)
> Quickbook could handle this better, something that's on my mind.
(The template name would help - I had half the Greek alphabet to choose
> > Are there other issues that I am not aware of?
> Of the top of my head: templates and macros have different scoping rules,
> can use macros in some places where you can't use templates (I forget
> where, I'll look into it later), and macros can be used for a conditional
> (i.e. include a phrase if a specific macro is defined).
> The scoping rule is that macros are only defined for the file containing
> definition, and any files it includes, but templates are global. So you
> macros in a file and then include it (like you do in 'html4_symbols.qbk').
> This is an issue - there's a very old 'fixme' comment in the source which
> templates should be scoped. But this would break a lot of existing
> documentation, so I haven't followed it. I have a half formed plan to deal
> - there's an email about this subject that I never get round to writing.
This would seem a *killer* issue. For html symbols, won't it be MUCH more
to be able to include html4_symbols.qbk in my_main.qbk, (or most
and then be able to use them anywhere?
my_section1.qbk, my_section2.qbk ...
Or am I misunderstanding? Or are you saying that if I include
html4_symbols.qbk containing macros in
my_section1.qbk, I can't use them in my_section2.qbk?
I also observed, and do again " it seems more consistent to use templates
for both nullary and multiplary (if that's the word ;-)"?
--- Paul A. Bristow, Prizet Farmhouse, Kendal LA8 8AB UK +44 1539 561830 07714330204 pbristow_at_[hidden]
This archive was generated by hypermail 2.1.7 : 2017-11-11 08:50:41 UTC