Comments (3)
Hi,
Thank you for contributing continuation.js. The style you have given in the example is another style, which is used by streamline.js or wind.js. It is definitely possible to implement, but I personally do not prefer it, because it is hard to support multiple return values. It is a convention that the first parameter of the callback function is the error object, therefore I implemented both cont
and obtain
. If the callback function has more than 2 parameters, for example:
var request = require('request');
request('http://www.google.com', function (err, response, body) {
})
How do you handle the return values using a function return value? You can wrap them into an array, but it will make your code even uglier.
from continuation.
Yes, i perfectly understand your point of view.
But programmers are addicted to left assignment passing style and there are few cases in which a function need to return multiple values. The error and a single value are sufficient in my opinion, you can also return a object with multiple keys and that is solved.
I really love your work, i was searching for a compiler which was usable both on client and server side and yours is the only one i found really good (i loved the sintax of streamline but it doesn't work well on the browser side).
The only thing is that it is really difficult to me to read right assignment style (also my ide marks passed values as errors and, you know, it is quite ugly to see a code with lots of non-errors, etc..).
I was very interested in your project so i forked it to https://github.com/eurekaa/continuum.js
and did some changes (add async stuff, new compilers (less, jade, ..) and start to try to change left into right assignment style but i don't know so much about transformation so i'd like to ask you if you'd like to help me (in need some suggestions to start).
Maybe it would be nice to add left assignment style to continuous in order to have both.
What do you think about?
from continuation.
Yes you can do that. Please tell me if you have any problem.
from continuation.
Related Issues (20)
- The compiler allow non-lvars as argument to cont() etc.
- Heuristics for exceptions don't work HOT 2
- Arguments scope bug HOT 2
- cont() and obtain() do not work when instantiating a class HOT 1
- using 'continue' in for (... in ...) HOT 2
- single file to use in browser or|and embed with rhino HOT 2
- Running compiler from the browser HOT 1
- Wrong binding of `this` inside `if`/`while/`for` HOT 1
- function declaration should goes to the top level HOT 3
- module searching terminates unexpectedly at certain directory HOT 1
- Wrong context when using `cont()` in switch..case HOT 1
- When using `cont()` in `if` block, the context in `if` is correct while the context after `if` is incorrect. HOT 1
- `this` get lost in try block
- new statement is mistakenly parsed in cont()'d block HOT 1
- Portable continuations? HOT 3
- ECMAScript 6 is not supported
- Incorrect textual representation of time
- Textual representation of time incorrect
- Want to meet
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 continuation.