Boost logo

Boost :

From: Vesa Karvonen (vesa_karvonen_at_[hidden])
Date: 2004-06-10 15:56:01


David Abrahams:
>I'm writing an appendix on the PP lib for the MPL book today. I think
>that'll demonstrate that it's possible to provide a reasonable gentle
>and high-level introduction without exposing too many ugly details.

That would be great!

>- Fundamental PP Abstractions
> - Macros
> - Non function
> - Function macros
> - Tokens
> - Sequences of tokens not including un-parenthesized commas

Data structures are an important topic and their representation isn't
fundamentally PP *library* specific. You might want to present the
information on the representation of data structures (and simple macros
like a projection operator for tuples and some sequences operations) here
when you discuss fundamental PP abstractions.

I would also probably discuss how to implement primitives like IF and
WHILE using preprocessor macros at this point. The purpose being to show
that the preprocessor is capable of significant computation. I would also
emphasize that the purpose of explaining the techniques is not that people
would roll their own versions, but simply to deepen their understanding of
the preprocessor.

>Well, if you really have a conforming C99 preprocessor, you could use
>Paul M's Chaos, which I think is both easier to use and *way* more
>efficient than the current Boost PP.

>From what I know, Chaos is essentially an extended Boost.PP (meaning that
Chaos is essentially a combinator library), with a single recursion
backend (enabled by stricter requirements on preproprecessor conformance),
which makes it more orthogonal. However, Chaos still shares many problems
with Boost.PP, the main issues being that code will be highly verbose and
very intricate. The verbosity and intricacy probably do not matter that
much when one only performs simple repetition using the canned library
macros.

-Vesa Karvonen

_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk