-
-
Save grncdr/1624546 to your computer and use it in GitHub Desktop.
just changing names
This file contains hidden or 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
// block-lambda proponents: what does this program do? | |
function in_canadian (speak_cb) { | |
add_eh = {|y| | |
return y + ", eh?" | |
} | |
// now here comes a bunch of code. | |
// imagine there are 50 lines here | |
speak_cb(add_eh) | |
// now a bunch more stuff. | |
// eventually: | |
add_eh("How bout them 'nucks") | |
// then a bunch more stuff | |
// ending with: | |
return "Aboot" | |
} | |
var message = in_canadian(function (accent) { | |
alert("before") | |
accent("It's cold outside") | |
alert("after") | |
}) | |
alert(ret) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment