* 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
_______________________________________________
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to