Created
September 25, 2011 08:36
-
-
Save pikeas/1240388 to your computer and use it in GitHub Desktop.
Callback confusion 2
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
#I'm trying to write a wrapper function to use in place of long nested callbacks like a(b(c())). | |
runner = (cb, args...) -> | |
puts 'run' | |
cb(args...) | |
a = (cb, args...) -> | |
puts 'a' | |
cb(args...) | |
b = (cb, args...) -> | |
puts 'b' | |
cb(args...) | |
c = -> | |
puts 'c' | |
#Why doesn't this work? | |
runner(a, b, c) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment