|
Boost : |
Subject: Re: [boost] [preprocessor] pp-strings
From: lcaminiti (lorcaminiti_at_[hidden])
Date: 2011-06-28 09:18:46
Paul Mensonides wrote:
>
> On Mon, 27 Jun 2011 06:39:00 -0700, lcaminiti wrote:
>
>> Paul Mensonides wrote:
>>>
>>> On Sun, 26 Jun 2011 11:00:16 -0400, Lorenzo Caminiti wrote:
>>>
>>>> Any comment on "pp comma-separated strings" support (of lack of
>>>> thereof) in Boost.Preprocessor and/or CHAOS?
>>>
>>> Boost.Preprocessor represents the lowest common denominator in what can
>>> be made portable across most C and C++ compilers. The main roadblock
>>> to more significant improvement (nowadays) is VC++'s horrible
>>> preprocessor.
>>>
>>> By "comma-separated strings" I assume you mean something like: a, b, c?
>>> Boost.Preprocessor doesn't support them, of course. Chaos doesn't
>>> support them in that form (generally speaking, data structures
>>> containing open commas = bad design).
>>>
>>>
>> I am sorry, I meant to say "*space* separated strings" (not commas).
>> These are tokens like `a b c` where a character can be a-z, A-Z, 0-9, or
>> _ and all characters must be separated from each other by one or more
>> spaces. Concatenation can be used to parse these "space separated
>> strings", for example (leaving aside reentrancy issues, etc):
>
> Chaos supports such data structures. E.g.
>
> #include <chaos/preprocessor/algorithm/reverse.h>
> #include <chaos/preprocessor/generics/strip.h>
> #include <chaos/preprocessor/string/core.h>
>
> CHAOS_PP_REVERSE( (CHAOS_PP_STRING) a b c d e f )
> // (CHAOS_PP_STRING) f e d c b a
>
> CHAOS_PP_STRING_TO_UPPER(
> CHAOS_PP_STRIP(
> CHAOS_PP_REVERSE( (CHAOS_PP_STRING) a b c d e f )
> )
> )
> // F E D C B A
>
Yep, this is pretty cool :)) especially the `(pp-data-type) pp-data` syntax.
Great job with Chaos!!
What will it take to port the (splendid) Chaos library into Boost? "Just"
fixing VC++ pp or more?
Btw, are Chaos docs online in HTML form somewhere?
--Lorenzo
-- View this message in context: http://boost.2283326.n4.nabble.com/preprocessor-pp-strings-tp3613014p3630324.html Sent from the Boost - Dev mailing list archive at Nabble.com.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk