On Sun, 2011-03-06 at 17:45 +0100, Simen kjaeraas wrote:
> Russel Winder <[email protected]> wrote:
> 
> > So why does:
> >
> >         reduce ! ( function double ( double a , double b ) { return a +  
> > b ; } ) ( 0.0 , outputData )
> >
> > fail?  It implies that a function literal and a lambda are significantly
> > different things as far as the compiler is concerned.
> 
> Well, they are. One is a delegate literal, the other a function literal.
> Delegates may be closures, functions may not.

Hummm... good point.  If you s/function/delegate/ in the above it works
fine

> That said, the above looks like it should work, and I'm not sure why it
> doesn't.

Obviously (now :-) because the context requires a delegate not a
function -- it is just that the error message doesn't say that in terms
that don't relate to the code they relate to the realization within the
compiler.

Is this use of the term delegate consistent with the C# idea of
delegate?  It certainly is not consistent with the use in Groovy and
other dynamic languages. 

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:[email protected]
41 Buckmaster Road    m: +44 7770 465 077   xmpp: [email protected]
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to