Comments (4)
You forgot new
from rapydscript-ng.
Duh. And I confused what's possible within a self-contained program and in an external library. As your README says about new, "This is very useful for avoiding a common JavaScript error of creating 'undefined' objects by forgetting this keyword."
MIght it be useful to have a compile flag, say "--library", so that a Python class would be compiled to something like this?
function PhysAxis(obj, numLabels, args) {
if (!(this instanceof PhysAxis)) return new PhysAxis(obj, numLabels, args)
Or more generally, why not always compile classes this way, and eliminate inserting "new" into calls to them? Then the transpiled program would work either as a main program or a library, wouldn't it?
from rapydscript-ng.
Not worth it, IMO. Every extra output option, slows down compilation, because the result of running with it has to be cached, to enable incremental compilation. Also, it means that the function cannot be used as a generic anymore, which is common in at least some parts of the JS ecosystem, and I think it will break at least some types of multiple inheritance.
from rapydscript-ng.
I obviously don't know all the ramifications, but if it were an optional flag?
from rapydscript-ng.
Related Issues (20)
- Import problem? HOT 4
- class decorator bug HOT 5
- when converting .children() to list, i get list of empty dictionaries HOT 4
- Remove typing/annotations from input HOT 1
- Ellipsis HOT 7
- bitops on booleans HOT 1
- string.split() HOT 3
- random.randint tolerates 3rd argument HOT 3
- distionary += error HOT 21
- Build question HOT 5
- pop for dict, pypop for list HOT 8
- Idle curiosity about duplication HOT 1
- Missing element from rapydscript.js?
- Mistranspilation HOT 2
- Remove a list from a list HOT 4
- while/else HOT 3
- randrange error
- Function argument handling
- Comical Bundle Size HOT 1
- Large slowdown HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rapydscript-ng.