On Thu, Mar 22, 2001 at 12:40:03PM +0000, John Levon wrote:
> On Wed, 21 Mar 2001, Andre Poenitz wrote:
> 
> > I admit that functors in the current Standard Lirary are clumsy to use.
> > If LyX would use them on a regular base I'd suggest to use the 'Lambda
> > Library' which makes those things much easier to write and more pleasing to
> > the eye, but for the occasional for-loop this would be overkill.
> > 
> > Andre'
> > 
> 
> Where can I get this ? Freshmeat turns up blank.
> 
http://lambda.cs.utu.fi/

I didn't know either, but jumped on it the instant I read André's message.
Seems it can make all those pesky five-lines functors a bad memory.

With LL, you can write things such as:
vector<double> angles;
vector<double> sines;
const double pi=42; // for really big values of pi
...
transform(angles.begin(), angles.end(), sines.begin(), 
          - bind(sin, free1 * pi/180.0));

In other words, using directly the lambda-expression
$\lambda x.-sin(x*pi/180)$

It works with simple expressions, functions, functors, member functions,
has control flow, exceptions handling ...

[snip]
> 
> thanks
> john
> 
> -- 
> "You say my kisses are not like his
>  But this time I'm not going to tell you why that is
>  I'm just gonna let you pass
>  Yes, and I'll go last"
>       - Bob Dylan

-- 
        Yves

Reply via email to