From: Eric Niebler (eric_at_[hidden])
Date: 2008-03-18 12:50:17
Larry Evans wrote:
> On 03/18/08 10:30, Eric Niebler wrote:
>> These are domain-specific use cases. The code for that belongs in your
>> DSEL, not in Proto.
> OK. But so is:
> -x + x -> 0
> 0 + x -> x
> domain specific, which is what Markus was asking for.
Right, Markus was just looking for some examples. He didn't want me to
put those transforms in Proto.
> Now I could just translate:
> Empty( A | B ) -> Empty<A> * Empty<B>
> Empty(grammar_terminal) -> 1
> Empty(epsilon) -> 0
> and I've got what I want and it's in the domain Markus was talking
> about. So, if you do it for the arith domain (Markus'), then
> you'd have to have a set of "simplification rule" for that
> domain. Replace the simplification rules for arith domain
> with simplification rules for domain X, where X is
> boolean expressions or grammar expressions or some other
> domain, and you've generalized what you can simplify.
> My point was that If you can do it for Markus' domain, then
> you can to it for domain X. IOW, provide a set of simplification
> rules for a particular domain.
> Maybe the next version? ;)
It still doesn't belong in Proto. I see it as analogous to custom
grammars and Spirit. Just because someone has written a useful grammar
doesn't mean that Joel should make it part of Spirit. Instead, there is
a separate Spirit app repository for these bits of useful Spirit code.
Maybe there should be a Proto app repository, or maybe you and Markus
can write the expression reduction transform and I can put it in
-- 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