Created
December 23, 2011 23:56
-
-
Save xcoderzach/1515724 to your computer and use it in GitHub Desktop.
Awaiting Apples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this is what it would look like, | |
# Every language feature that isn't a function has to be turned into one :-( | |
awaitWhile {apples: []}, ({apples}) -> numThatAreTasty(apples) < 10 | |
, (await) -> | |
await (defer) -> getAnApple defer "apples[]" | |
, ({apples}) -> | |
console.log apples | |
awaitWhile {apples: [], numTasty:0}, ({numTasty}) -> numTasty < 10 | |
, (await) -> | |
await (defer) -> getAnApple defer "apples[]" | |
await (defer) -> countTasty apples, defer "num_tasty" | |
, ({apples}) -> | |
console.log apples |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment