[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Looking for (KDE) lib/class to perform calculations
From:       Bo Thorsen <bo () sonofthor ! dk>
Date:       2002-03-26 13:35:55
[Download RAW message or body]

On Tuesday 26 March 2002 14:21, Rik Hemsley wrote:
> #if Bo Thorsen
>
> > On Monday 25 March 2002 10:01, Rik Hemsley wrote:
> > > #if Rob Kaper
> > >
> > > > Is there a class/method/lib in KDE/Qt to perform calculations?
> > > >
> > > > Something like KCalculator::calculate(const QString expression) or
> > > > something that let's me do int result = calculate( "(3*%1)+40" ).(30)
> > > > which will return 130..
> > >
> > > Have a look at 'spirit'. It allows you to write a parser in (very
> > > few lines of) pure C++.
> > >
> > > The examples include a calculator which seems to be almost exactly
> > > what you're looking for.
> >
> > Please don't. As quite a lot of people have pointed out, a calculator
> > parser is pretty easy to do.
>
> Please don't ... use some existing software specifically designed for
> this purpose ? Hmm ? NIH ?

Give me one good reason to do so. Incorporating something like spirit is 
extreme overkill in this case. koffice/lib/koscript already includes 
bison/flex stuff that will be more than enough for this.

Bo.

-- 

     Bo Thorsen                 |   Praestevejen 4
     Free software developer    |   5290 Marslev
     SuSE Labs                  |   Denmark
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic