2008/7/15 Sam Liddicott <[EMAIL PROTECTED]>:

>  * Jared Moore wrote, On 15/07/08 10:40:
>
>
>  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);
>        };
>
>
>
>  's' is the formal parameter of the function, just like s and p are
> formal parameters in the first example. You could put parentheses
> around it if you like, but you don't need to because in that case
> there's only one parameter.
>
>
>  Thanks.
>
> In that example do you know what s signifies?  - The signal foo doesn't
> seem to take any parameters.
>

Hi,

Signal handler always have the "signal sender" as 1st parameter, in this
case it would be the AdvancedSample instance from which the "foo" signal
originated.

I proposed the "sender" keyword inside signal handler context (just like the
"this" keyword inside the object instance context) to eliminate this
confusing parameter a while ago, but it didn't seem like a good idea for
many people.

--
Ali
_______________________________________________
Vala-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to