Hacker News new | comments | show | ask | jobs | submit login

There's already a branch of CoffeeScript, called Iced CoffeeScript (http://maxtaco.github.com/coffee-script/), that does this. The example in the post would look like:

  for blogPostId in recentBlogPostIds
    await asynchronousDB.getBlogPostById blogPostId, defer(err, post)
    templating.render post
Though you still can't simply return the result — you'd have to use a continuation — but it does make it simple enough to use CPS in general.



Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: