> Folks,
>
> I don't do much with co-expressions and was wondering, when you code  x @
> ce, x gets transmitted to ce.  But how does it arrive in ce?
>
> If I had something simple like
>
> ce := create i +:= 1
> i := 9
> i @ ce
>
> Then the i in ce is null.  How is the i transmitted to ce?
>
> David

First activation, the transmitted value is discarded because there's nowhere 
to receive it.

However if your co-expression activates another in a cooperating way:


procedure seq()
    local n, i

    i := 0
    while (i +:= 1) do {
        n := i @ &source
        i := \n
    }
end

procedure main()
    local i, x, s

    i := 0
    x := 0
    s := create seq()

    while (i +:= 1) < 10 & x := (x + 10) @ s do
        write(i, " ", x)
end

Here, I'm pumping the number returned + 10 back into the suspended coexp and 
using it to bump the sequence forward. &source represents the coexp that 
activated the &current one





------------------------------------------------------------------------------
_______________________________________________
Unicon-group mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/unicon-group

Reply via email to