Re: [Vala] anonymous functions



* Sam Liddicott wrote, On 15/07/08 10:15:
I find this notation ugly:

                notify += (s, p) => {
                        stdout.printf("property `%s' has changed!\n",
                                      p.name);
                };


Is there a reason why the => should be required?

                notify += (s, p) {
                        stdout.printf("property `%s' has changed!\n",
                                      p.name);
                };


seems a lot more natural, all that's missing is the name cos there isn't
one...

Does the => signifiy anything particular?
  
And in the advanced example:
http://live.gnome.org/Vala/AdvancedSample


what does the s signify in

        this.foo += s => {
            stdout.printf ("Lambda expression %s!\n", name);
        };


Thanks

Sam



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