Boost logo

Boost :

From: Eric Niebler (eric_at_[hidden])
Date: 2008-03-18 11:30:10


Larry Evans wrote:
> On 03/17/08 23:45, Larry Evans wrote:
>> On 03/17/08 17:55, Eric Niebler wrote:
>>> Larry Evans wrote:
>>>> Me too!
>>> I couldn't tell from your email -- what are you me too-ing?
>> flattening a sequence of binary operators into one list
>> with a tag indicating the operator to be applied between
>> elements in the list.

See my reply to Markus. Use proto::flatten() and proto::unpack_expr().

> And also the means for simplifying an expression somewhat
> like described by Markus:
>
>> I want to detect simultaneous occurences of
>> x and -x and have them dropped from the typelist of my sum.
>
> Use case1:
>
> translating a grammar expression:
>
> x | x
>
> to:
>
> x
>
> Use case2:
>
> Step 1:
> translating grammar expression:
> A | B
> to an expression representing if it can derive empty
> string:
> empty<A> | empty<B>
> which, if A is a the epsilon symbol then emptt<A> == true_
> and the whole expression simplifies to:
>
> true_

These are domain-specific use cases. The code for that belongs in your
DSEL, not in Proto.

-- 
Eric Niebler
Boost Consulting
www.boost-consulting.com

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