[e-lang] Labeled promises?

Kevin Reid kpreid at attglobal.net
Tue Nov 29 14:06:23 EST 2005


Would it break anything in the E model to attach labels to promises?

Something like this:

   ? def [p1, r1] := Ref.promise("aardvark")
   # value: [<aardvark promise>, <aardvark resolver>]

   ? def [p2, r2] := Ref.promise("animal")
   # value: [<animal promise>, <animal resolver>]

   ? r2.resolve(p1)
   ? p2
   # value: <aardvark promise>

   ? r1.resolve(aardvark)
   ? p2
   # value: <Bob, the aardvark>

This would be primarily useful for debugging, such as finding out  
"how far" a promise for a promise for ... has been resolved, or "What  
was this promise that's showing up in my stack trace supposed to have  
already been resolved to?"

-- 
Kevin Reid                            <http://homepage.mac.com/kpreid/>




More information about the e-lang mailing list