Re: [Vala] Autocasting for lambdas
- From: "Sam Liddicott" <sam liddicott com>
- To: pancake <pancake youterm com>
- Cc: Vala ML <vala-list gnome org>
- Subject: Re: [Vala] Autocasting for lambdas
- Date: Thu, 23 Apr 2009 10:38:23 +0100
* 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]