Skip to content

Instantly share code, notes, and snippets.

@grncdr
Forked from isaacs/find-the-block.js
Created January 17, 2012 03:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grncdr/1624546 to your computer and use it in GitHub Desktop.
Save grncdr/1624546 to your computer and use it in GitHub Desktop.
just changing names
// 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