Il Vala Tutorial ha un example about DBus using anonymous methods.Come si chiudono le chiusure di Valas su Genie?
Bus.own_name (BusType.SESSION, "org.example.DemoService", /* name to register */
BusNameOwnerFlags.NONE, /* flags */
on_bus_aquired, /* callback function on registration succeeded */
() => {}, /* callback on name register succeeded */
() => stderr.printf ("Could not acquire name\n")); /* callback on name lost */
Sto cercando di riscrivere questo codice in Genie, ma non riusciva a convertire le ultime due righe. Lo Genie Tutorial ha solo an example on how to use a closure to define an event handler.
f.my_event += def (t, a)
print "event was detected with value %d", a
Come utilizzare le definizioni di metodo anonime in una chiamata di metodo con Genie?