Boost logo

Boost Users :

Subject: Re: [Boost-users] [Proto] implementing an computer algebra system with proto
From: MaximYanchenko (maximyanchenko_at_[hidden])
Date: 2009-01-28 00:47:17


Hi Eric,

> Here is a toy example to get you started.
>
> , proto::when<
> proto::assign<
> proto::plus<proto::terminal<placeholder>, _>
> , _
> >

It looks like this "when" matches everything (at least with my compiler), not
only plus (as supposed to), for example it matches multiplication as well:
       proto::display_expr( var_ * 1 = 2 );
       proto::display_expr( Solve()( var_ * 1 = 2 ) );

Output:

assign(
    multiplies( // <<<<< multiplication
        terminal(var_)
      , terminal(1)
    )
  , terminal(2)
)
assign(
    terminal(var_)
  , minus( // <<<<< minus
        terminal(2)
      , terminal(1)
    )
)

I'm using proto from boost 1.37.0, gcc 3.4.6.

Thanks,
Maxim


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net