[Vala] [Genie] Anonymous functions



Chris,

I'm not sure genie support closure, if someone can confirm...
For the delegate, try something like this:

[indent=4]

delegate DelegateType (a : int) : bool

def f1 (a:int) : bool
    print "testing delegate value %d", a
    return true

def f2 (d:DelegateType, a:int)
    var c = d (a)

init
    f2 (f1, 5)

Regards,
Nicolas.



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