[e-lang] multiway when-catch
Rob Withers
reefedjib at yahoo.com
Mon Oct 29 15:36:54 EDT 2007
Thanks, Kevin ...
----- Original Message -----
From: "Kevin Reid" <kpreid at mac.com>
To: "Discussion of E and other capability languages"
<e-lang at mail.eros-os.org>
Sent: Monday, October 29, 2007 11:45 AM
Subject: Re: [e-lang] multiway when-catch
> On Oct 29, 2007, at 14:16, Rob Withers wrote:
>> If so, what does it look like?
>
> You can ask the implementation: just do interp.setExpand(true) then
> enter the code you want to see the expansion of, or write it inside
> of an e`...` quasiquote.
I am installing now and will do this.
>> ... where #getFork returns an eventualRef and the #% message
>> concatenates promises to create a promiseSet. Unfortunately,
>> nothing holds onto the promiseSet so it is getting GCed. I suspect
>> that I need to pass the promiseSet as an argument to #whenResolved:
>> msgs sent to each promise, but I am not sure how.
>
> I think your promiseSet corresponds to the components produced by
> promiseAllFulfilled, which multiway-when uses, as you will see in the
> expansion. I recommend that you simply compile/translate
> promiseAllFulfilled.emaker to your platform, as it is entirely non-
> primitive and well-designed.
I was unable to find promiseAllFulfilled.emaker, but I am still looking.
> Particularly, there should not be any weak references involved, so GC
> is irrelevant.
I have strong references. I think I may have fixed the problem I was having
by passing the promiseSet as an argument to the #whenResolved: msgs I send
to each promise. I am now resolving the promiseSet and getting into the
block.
One other question I had, I once saw code that conditioned a promise to
resolve within a certain timeout, otherwise it broke. Do you happen to know
code that could do this?
thanks again,
Rob
More information about the e-lang
mailing list