Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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 | Lists | API | Security | Legal | Apply to YC | Contact

Search: