[Vala] Autocasting for lambdas



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 would like to be able to drop or move the (Grava.Node *) definition
somewhere else with <Grava.Node> or so instead of storing two local
variables.

Thanks



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