Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dynamic Programming in Boo
Message
De
07/07/2010 16:45:03
 
 
À
07/07/2010 15:15:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Divers
Thread ID:
01471462
Message ID:
01471742
Vues:
62
Just thinking about this:
I assume Boo would have the same problem as C# when using anonymous methods: viz. there is no way to 'unwire' the event if that should be neccessary?

>That _is_ cool.
>
>The reason that the o,e are passed is that the def is of an unnamed function that is the eventhandler method. In C#, if you type in the line you did, the IDE (in VS2010) will complain that the function you named is not available. You then have to define that method.
>
>private void ButtonClick(object o, EventArgs e)
>{
>
>}
>
>in order to compile, of course. So that still looks like a lot of extra typing to me. <s> In fact, it looks as though it is twice as much typing, if not more. If I can cut out half the typing I do (and I don't think it will be that much, probably more like 20-30%) over the next 15 years of my working career, I would like that. This is all individual, of course; I have a couple of friends who type code out at 90+ words per minute. For myself (I'm sure this is not universal), having fewer superfluous words means I can focus on the meat of what is being done. à chacun son goût, as they say.
>
>Hank
>
>>>At the most, Boo's compiler does more, as I indicated. For example, if I have a button b, then I can define an eventhandler and an eventhandler method like so:
>>>
>>>b.Click += def(o,e):
>>> b.Text = "Clicked"
>>
>>Not sure what the (o,e) means, but in C# you simple do:
>>
>>b.Click += ButtonClick
>>
>>
>>Seems less verbose to me
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform