[e-lang] multiway when-catch

Rob Withers reefedjib at yahoo.com
Mon Oct 29 22:36:22 EDT 2007


----- 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 5:43 PM
Subject: Re: [e-lang] multiway when-catch


> On Oct 29, 2007, at 17:50, Rob Withers wrote:
>
>> % eventualRef
>>     "Add an eventualRef to the list"
>>     refs add: eventualRef.
>>
>> initialize
>>     refs := OrderedCollection new.
>>
>> whenResolved: reactor
>>     | countDown |
>>     countDown := refs size.
>>     refs do: [:each |
>>         each whenResolved: [:aRef |
>>             countDown := countDown - 1.
>>             countDown <= 0
>>                 ifTrue: [reactor valueWithArguments: refs asArray]]].
>
> Okay, this looks reasonable, though it's more mutable than is good
> style. However, whenResolved is not a primitive operation on
> references. Look at jsrc/org/erights/e/elib/ref/Ref.java for the
> implementation of whenResolved.

I see that, now that you point it out.  I am sure there is a good reason for 
it.  Is it because you want to limit the MirandaMethods defined, and 
__whenMoreResolved handles the behavior of what you want, so whenResolved 
and whenBroken are specified in terms of __whenMoreResolved?  Or are there 
other reasons?

Rob 



More information about the e-lang mailing list