public
Last active — forked from isaacs/find-the-block.js

just changing names

  • Download Gist
find-the-block.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
// 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)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.