in reply to lazy evaluation of sub arg
A prototyped function such as promise() is properly invoked only after the function is either declared or defined. In the code shown in your post, I see promise() invoked before the function is defined, and there is no prototype declaration for the function shown at all. This may just be an artifact of composing the post (an entirely self-contained executable example is always preferable), but it is something to consider.
Update: I posted this before I saw drbean's first reply. I think he or she is on the right track now.
|
|---|