How do Valas closures map to Genie?

后端 未结 2 1229
耶瑟儿~
耶瑟儿~ 2021-01-05 18:03

The Vala Tutorial has an example about DBus using anonymous methods.

Bus.own_name (BusType.SESSION, \"org.example.DemoService\", /* name to register */
              


        
相关标签:
2条回答
  • 2021-01-05 18:28

    I think there is not way. You must call another process using "def".

    Bus.own_name (BusType.SESSION, "org.example.DemoService", 
              BusNameOwnerFlags.NONE, 
              on_bus_aquired, 
              reg,
              err);
    
    def reg()
        pass
    
    def err()
        print "error"
    
    0 讨论(0)
  • 2021-01-05 18:39

    This isn't possible at the moment:

    https://bugzilla.gnome.org/show_bug.cgi?id=746704

    Currently Genie only support the deprecated lambda syntax for signals (+=). This patch provides lambda support in most constructs, the only requirement is that braces and parens need to be indent-balanced on multiple line constructs.

    0 讨论(0)
提交回复
热议问题