On Mon, Jan 30, 2012 at 1:41 AM, Kees Bos <[email protected]> wrote:
> On Sun, 2012-01-29 at 19:38 -0600, C Anthony Risinger wrote:
>> On Sun, Jan 29, 2012 at 3:23 PM, Peter Bittner <[email protected]> wrote:
>> > Just for curiosity's sake:
>> >
>> >> $wnd.__pygwt_modController.load($pyjs.appname, [
>> >> 'lib\pyjamas.ui.Panel.js',
>> >> 'lib\pyjamas.ui.HTML.js',
>> >> 'lib\pyjamas.Window.__oldmoz__.js',
>> >> 'lib\pygwt.__oldmoz__.js',
>> >> 'lib\pyjamas.Factory.js',
>> >> 'lib\pyjamas.ui.js',
>> >> 'lib\pyjamas.ui.InnerHTML.js',
>> >
>> > Why do we need dollar signs in JavaScript code? Hmm...
>>
>> `$` is not allowed in python identifiers, thus it guarantees no
>> conflict between the two.  unfortunately it's used to protect JS from
>> python (python gets the `$`-less version), and remap tables are used
>> when conflicts arise; i would have done it reverse, where everything
>> python gets the `$`, and that would eliminate the need for remap
>> tables (no native JS objects start with $).
>
> This is historically. The integration between python code and javascript
> used to be very tight. I doubt if that's still needed nowadays.

could you elaborate [slightly]?  do you mean the `$` themselves are
not needed (eg. because of things like dict keys in a special object,
vs. raw JS attribute), or the remap tables, or ... ?  doesn't the
translator automatically detect collisions now?  i know the `$` is
used all over the place to store temporary JS variables for
implementation of iteration, boolean/typeof, etc, but i don't know if
it's strictly necessary.  from a JS() standpoint at least, the
separation is kinder (personally i like knowing if a var is JS/Python
namespace just by convention alone).

-- 

C Anthony

Reply via email to