Boost logo

Boost :

From: Korcan Hussein (korcan_h_at_[hidden])
Date: 2005-10-24 08:06:00

"Larry Evans" <cppljevans_at_[hidden]> wrote in message
> I'm unfamiliar with polymorphic variants. Could you please give a brief
> explanation or reference? Is it any way related to the topic discussed
> here:

OCaml supports normal varaint types and some called polymorphic types, i'm
not sure if i understood them correctly myself but from what i think
understand of them is that the set of (possible) types are not closed,
allows of for code-reuse etc but i might be wrong. OCaml's definition can be
found here: (in
the variant types section).

"Larry Evans" <cppljevans_at_[hidden]> wrote in message
> On 10/24/2005 04:08 AM, Korcan Hussein wrote:
> [snip]
>> I relized this when i was reading Spirit's documentation. I did mention
>> from
>> the begining all terminal leaf node types must be given, like in an MPL
> What's a "terminal leaf node type"?

Sorry i couldn't think of a better term/word to use, but basically the types
of operands of an overloaded operator (excluding composite type). In the
case of Boost.Spirit these would be all the primitive parsers. As Joel de
Guzman was saying the problem is Boost.Spirit allows you to add not only new
primitive parsers but composite parsers too, it is open to extension.

> where Expression is some nonterminal in the grammar. Is Tp what
> you refer to as a "terminal leaf node type"?

Essentially yes, if this was generalized one way this could work is the user
gives a boost.mpl sequence of types of operands (possibly give a sequence
types for composite types depending on the context). Unfortunately this
doesn't scale to well for Boost.Spirit since new types of either kind could
be added later on which requires adding a new type to either type sequence
and then recompilation.

Boost list run by bdawes at, gregod at, cpdaniel at, john at