[e-lang] makeMultiChannel (was EProxyResolver and ...)
Kevin Reid
kpreid at mac.com
Sun Mar 25 07:56:04 CDT 2007
On Mar 25, 2007, at 1:41, Mark S. Miller wrote:
> Kevin Reid wrote:
>> Here's the session, in which it behaves like I expected it to:
>>
>> ? def makeMultiChannel := <import:makeMultiChannel>
>> # value: <makeMultiChannel>
>>
>> ? def [a, d] := makeMultiChannel()
>> # value: [<Promise>, <distributor>]
>>
>> ? def r1 := a <- run("1")
>> # value: <Promise>
>> [...]
>> ? r1 <- __whenMoreResolved(println)
>> # value: <Promise>
>> response to 1
>>
>> ? d.forward(fn x { println(`got again $x`); `response again to $x` })
>> got again 1
>> response again to 1
>>
>> ? a <- ("two")
>> # value: <Promise>
>> got two
>> got again two
>
>
> I'd expect it to also print
>
> response again to two
>
> Am I confused?
"response to two" and "response again to two" should be the two
values of the reference returned by a <- ("two"), which is not the
same as r1, the one with the __whenMoreResolved message doing printing.
I can't check this because my repl doesn't keep value history, but,
starting with a fresh message:
? def r3 := a <- ("three")
# value: <Promise>
got three
got again three
? r3 <- __whenMoreResolved(fn x { println(`r3 value: $x`) })
# value: <Promise>
r3 value: response to three
r3 value: response again to three
--
Kevin Reid <http://homepage.mac.com/kpreid/>
More information about the e-lang
mailing list