Re: [Vala] Autocasting for lambdas



Sam Liddicott wrote:
* pancake wrote, On 23/04/09 10:33:
It is possible to reduce this code?

gw.graph.nodes.sort(
(a,b) => {
Grava.Node *na = a;
Grava.Node *nb = b;
return (int)(na->y - nb->y);
}
);

I don't think you can do this, but try it - it would be nice if it would
work:

gw.graph.nodes.sort(
(Grava.Node *a, Grava.Node *b) => {
return (int)(a->y - b->y);
}
);

It certainly matches the non-lambda way of doing it (which in C might
require a cast of the function pointer).

Sam

No this is not working. This is why i'm asking :)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]