Boost logo

Boost :

From: Paul Mensonides (pmenso57_at_[hidden])
Date: 2003-04-12 19:34:44


Joel de Guzman wrote:

> Hmmm.... how about namespaces (or modules) ? :o)...
>
> #< BOOST_PP // boost PP namespace
> // blah blah blah....
> #>
>
> #< MY_MODULE // my module namespace
> #using BOOST_PP // using boost PP namespace
> // blah blah blah....
> #>

Hi Joel, I'm already in the process of writing a paper with an alternative
version of the above. Problem #1: the operator directives are evil. They are
not visible, and with serve to make code that includes them hard to read. We
need a named alternative at least. Problem #2: No true scoping is achieved:

#<
#define DETAIL 123
#define INTERFACE DETAIL
#export INTERFACE
#>

INTERFACE // ?

This is what I'm going to propose:

# region // unnamed
# import ABC
# define XYZ
# define INTERFACE 123
# export INTERFACE
# endreg

XYZ // XYZ
INTERFACE // 123

# region BOOST
# region DETAIL
# define ABC 123
# endreg
# define INTERFACE BOOST::DETAIL::ABC
# define OTHER 123
# export OTHER
# region A
# define MACRO 123
# endref
# region B
# define MACRO 123
# endif
# export A
# endreg

ABC // ABC
DETAIL::ABC // DETAIL::ABC
BOOST::INTERFACE // 123
OTHER // 123

A::MACRO // 123
B::MACRO // B::MACRO

What do you think?

Paul Mensonides


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