[e-lang] multiway when-catch

Kevin Reid kpreid at mac.com
Mon Oct 29 20:43:01 EDT 2007


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.

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




More information about the e-lang mailing list