You are right, I meant to say anonymous functions.

I think it's a shame that Guido refuses to add this. Almost all modern
languages have anonymous functions. It's almost a standard when you are
dealing with frameworks and environments that require callbacks.

 - lex


On Sun, May 19, 2013 at 2:28 PM, Apexi 200sx <[email protected]> wrote:

> I think you mean lambda's/anonymous functions.  Python has closures,  It
> also has the lambda statement but this is a restricted version of anonymous
> functions as you can only have expressions not statements in them.
>
> Closures are functions that have the variables of their enclosing scope
> closed over and available to them.
>
> def create_adder(number_to_add=1):
>     def adder(x):
>          return x + number_to_add
>     return adder
>
> use...
>
> adder = create_adder(number_to_add=2)
>
> adder(1) returns 3
>
>
>
> On Sun, May 19, 2013 at 10:18 PM, Lex Berezhny <[email protected]> wrote:
>
>> I'm afraid to say this but Dart is actually cool enough to possibly
>> obviate the usefulness of pyjs.
>>
>> Biggest problem with Python in the async context is the lack of closures.
>> Without closures working in an async environment is just painful.
>>
>> I will continue to use Python in the context of Django and a few other
>> frameworks but I feel like web technologies are moving too fast for us to
>> keep up as an open source project.
>>
>> We're still trying to catchup with GWT 2.0 and google has already moved
>> onto Dart, Web Components, shadow DOM, etc.
>>
>> Maybe someone has a different perspective. I'm curious to hear what you
>> guys think about the future or usefulness of pyjs. Other than familiarity I
>> don't see what Python gives us now that there are other OOP languages
>> available to program the web UI.
>>
>> When choosing Python with OOP vs JavaScript with closures, I think OOP is
>> more important but now with Dart which offers OOP and closures, it's much
>> harder to justify the extra effort to use pyjs.
>>
>>  - lex
>>
>> --
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Pyjs.org Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Pyjs.org Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Pyjs.org Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to