// 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