Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
feedback on simple modules?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
g  
View profile  
 More options Feb 19 2012, 8:10 pm
From: g <wgordo...@gmail.com>
Date: Sun, 19 Feb 2012 17:10:56 -0800 (PST)
Local: Sun, Feb 19 2012 8:10 pm
Subject: feedback on simple modules?
So,

I have spent some time and have modules compiling.  I chose to use a
command line flag for pyjs.py and allow the previous functionality to
remain unchanged.  You have to specify that you want pyjs to compile
as modules.  I made sure that all tests still pass (on Windows) after
my modifications.

I did not see anywhere that pyjaco.append_module was being used for so
I started my changes here.

I have two tests that run under "tests/as_module/simple/".  Once you
run the test you will see a file that ends with .run.  That is the
javascript file that causes the js code to run.  It uses the
$PY.run_module function I added to builtins.

I decided that it would be best to pass modules a reference to the
__builtins__ module.  This will allow us to modify the pyjaco
namespace without needing to update any compiled code and it just
feels cleaner than reaching for a global __builtins__ object.  The
code could still fallback to the global __builtins__ object if
wanted.  I think it would be best if there was only one global
javascript object used for pyjaco in the future.

The run_module function also sets __name__ so that "if __name__ ==
'__main__'" initialization can be used.

Anyways, I was hoping for some feedback/thoughts.

Thanks,
Gordon


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
g  
View profile  
 More options Feb 22 2012, 4:03 pm
From: g <wgordo...@gmail.com>
Date: Wed, 22 Feb 2012 13:03:39 -0800 (PST)
Local: Wed, Feb 22 2012 4:03 pm
Subject: Re: feedback on simple modules?
I forgot to link the repo: https://bitbucket.org/pendletongp/pyjaco

I have also added "import foo.bar" and "import foo.bar as x" support
now.  The actual javascript implementation needs some work to behave
exactly like python, but it is currently functional.  So that is good.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »