GithubHelp home page GithubHelp logo

Building a library about rapydscript-ng HOT 4 CLOSED

kovidgoyal avatar kovidgoyal commented on May 31, 2024
Building a library

from rapydscript-ng.

Comments (4)

amitu avatar amitu commented on May 31, 2024

Try --bare flag.
On Tue, 31 May 2016 at 9:33 AM, BruceSherwood [email protected]
wrote:

In the README is a discussion about issues in calling routines in external
libraries. I need to go the other way, to produce from Python code a
JavaScript library. I successfully executed "npm install rapydscript-ng"
and "npm install" and successfully ran "rapydscript" which produced what
looks like correct JavaScript output, but when I try to reference a
function named "PhysGraph" in the library (which is a class in the original
Python file) I get an error message "PhysGraph is not defined", despite the
fact that there is a "function PhysGraph" in the JavaScript. Do you have
any suggestions about what I've done wrong? Thanks. (Incidentally, when I
initially ran the Python code through the REPL, the output was entirely
different and, in particular, didn't include any of the RS run-time
functions. I guess the REPL is just used for seeing how code fragments
compile?)


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#30, or mute the
thread
https://github.com/notifications/unsubscribe/AADlJs6My9p-OCO2KEF-h4_OCG7dcPhlks5qG7MSgaJpZM4IqKTE
.

from rapydscript-ng.

BruceSherwood avatar BruceSherwood commented on May 31, 2024

Thanks, I'll try that. Where does one find documentation on flags such as "bare"?

from rapydscript-ng.

amitu avatar amitu commented on May 31, 2024

--help on command line. Sub commands like compile have their own help too.
On Tue, 31 May 2016 at 7:41 PM, BruceSherwood [email protected]
wrote:

Thanks, I'll try that. Where does one find documentation on flags such as
"bare"?


You are receiving this because you commented.

Reply to this email directly, view it on GitHub
#30 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AADlJmiTacpwZ77BFQBkA54Dr6KoW27Cks5qHEGXgaJpZM4IqKTE
.

from rapydscript-ng.

kovidgoyal avatar kovidgoyal commented on May 31, 2024

By default all output produced by the compiler is in a private scope. You can use --bare or simply export the symbol manually by doing something like (I would recommend the latter approach since otherwise you pollute the global namespace with lots of unneeded things).

window.PhysGraph = PhysGraph in the .pyj file.

from rapydscript-ng.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.