On Sun, Oct 20, 2013 at 10:24 PM, Sarvi Shanmugham <sarvil...@gmail.com>wrote:
> Question 1: > The simple i=i*2 seems to have a complex translation. Can't it just > be i=i*2 in java script and handle the error when it happens? > Python allows you to overload the multiplication operator. We have to check at runtime if the objects being multiplied have overloaded multiplication. Also, native strings in Python overload the multiplication operator, that's why you can do: print '='*10 > Question 2: > The whole idea of using dictionaries to store functions seems > inefficient for access. Is there an alternative approach using say > prototype.bin() or other approaches to define and access these functions > that people have tried? > In javascript objects/dictionaries are one and the same, so one can't be more efficient than the other. >> a = {} Object {} >> a.foo = 3 3 >> a['foo'] 3 If you want to hack on pyjs internals you're definitely going to have to learn JavaScript. - 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 pyjs-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.