<br><blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;">> I'm fairly new to pypy and was only doing some experimenting with the <br>> javascript translator so far. First of all let me say that the whole <br>> project is pretty amazing!<br>><br>> After translating a couple of functions I tried translating a class, <br>> but was unsuccessful so far but since the docs mention supporting <br>> inheritance I guess this should be possible. Is it?<br>><br>> For instance if I have in RPython the following:<br>><br>> class test:<br>> def __init__( self, value ):<br>> self.value = value<br>> def meth1( self ):<br>> return self.value<br>> def meth2( self
):<br>> do_something_which_is_translatable( )<br>><br>> then how do I get the corresponding javascript code? Since the docs <br>> say jscompile should be invoked by 'jscompile module function_names' <br>> I'm kind of lost. The same holds for rpython2javascript it expects a <br>> list of functions.<br>><br>> Any insight or comment would be very helpful.<br>><http: //answers.yahoo.com/dir/index;_ylc="X3oDMTFvbGNhMGE3BF9TAzM5NjU0NTEwOARfcwMzOTY1NDUxMDMEc2VjA21haWxfdGFnbGluZQRzbGsDbWFpbF90YWcx?link=ask&sid=396546091"><http: //answers.yahoo.com/dir/index;_ylc="X3oDMTFvbGNhMGE3BF9TAzM5NjU0NTEwOARfcwMzOTY1NDUxMDMEc2VjA21haWxfdGFnbGluZQRzbGsDbWFpbF90YWcx?link=ask&sid=396546091"><br><br>Because usual way of invoking javascript on your browser is to call a <br>function, you need a function where you'll begin. Like:<br><br><br># class test as above<br><br>def f():<br>
test_instance = test(3)<br> test_instance.meth()<br><br>and translate function f. Your class will magically appear in translated <br>javascript.<br><br></http:></http:></blockquote><br>Thanks very much for the reply, I can certainly do things this way however being able to call methods directly sounds like a reasonable thing to me (both in python and in JS). Are there plans for adding this kind of functionality or there are reasons why you think this is not necessary?<br><br><br>Cheers,<br>John<br><p> 
<hr size=1><a href="http://us.rd.yahoo.com/evt=49935/*http://games.yahoo.com">Bored stiff?</a> Loosen up...<br><a href="http://us.rd.yahoo.com/evt=49935/*http://games.yahoo.com">Download and play hundreds of games for free</a> on Yahoo! Games.