This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On Jun 4, 2011, at 3:15 AM, Per Bothner wrote:
Could you try the attached patch? A review would be appreciated as well.
That works for me. Good catch with initializing result to something other than null. I suppose someone could still write a promise that evaluates to Location.UNBOUND, but that's probably unlikely enough to ignore. There's still a minor deficiency in print():
#|kawa:1|# (define my-promise (delay (throw (java.lang.Exception)))) #|kawa:2|# my-promise #<promise - not forced yet> #|kawa:3|# (force my-promise) java.lang.Exception
I would argue that the print at line 4 should say something like "#<promise - force threw a java.lang.Exception>" instead. How about the attached update to your patch?
Note I also changed force to add an extra check after the apply0 call, to match RnRS semantics for "nested" forcing.
Attachment:
Promise3.patch
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |