Have read the Promises wiki explanation...
We have used 'after', 'trace' and arrays in order to implement a somewhat 'promises' language construct.
In fact, there seems (to me) to be nothing in that wiki that can't be done in a somewhat straight forward way with tcl.
To wit:
When ?conditions: then ?script.
Whenever ?conditions: then ?script
As implemented, the "futures" statements are the script. Any change in data, or call backs from widgets are evaluated in the context of these When/Whenever procedures.
So no spaghetti callback.
A 'future' statement that is part of a When construct is executed only once.
A 'future' statement that is part of a Whenever construct is executed each time that the condition is met.
It is used as part of our speech rec application.
Whenever the Agent says "May I have your credit card number" -
If asked_previously, then:
TTS says "You already asked me for my credit card once, but here it is again."
End of If
End of Whenever
When Agent enters his_age or his_age is greater than 21 -
Calculate all_ages as $his_age + $my_age
End of When
This construct eliminates the need for the inline script to evaluate every verbal or haptic response. If the conditions are not met or even present, the callback is passed on as it would ordinarily.
The conditions (promises) and response (futures) are posited in advance.
The after can be used to implement or destroy a promise
And remember...it's simply a matter of time...and that is a human construct...