Ignore my previous email this morning!
I re-read Boriss and Paolo's reply one more time
and finally it dawns on me :)
I see it now! For confirmation and for the benefit of other newbies,
let me re-iterate what I understand from those two
emails. [ correct me if I am wrong. ]
---------------------------------------
The point that I missed was that
the cell C *points* to an unbound variable
(denoted as old_ub).
And it remains so forever :)
[ In analogy to C languange, cell C is a pointer. ]
No matter where we start (point A or point B),
at point C,
Ms is first assigned with the *content* of C
which is the unbound (old_ub),
and Mr is another unbound name (denoted as new_ub).
Next, Exchange swaps the above two.
Ms becomes new_ub, Mr old_ub.
So, Ms = M|Mr simply binds new-ub
with M|old_ub. Effectively, S is being
appened by M|old_ub.
At this moment, C is still pointed to old_ub.
--hp
> On Mon, 12 Dec 2005, Boriss Mejias wrote:
>
> > > declare P S in
> > > local
> > > Tag = {NewName}
> > > fun {NewPort S}
> > > C = {NewCell S} in
> > > {NewChunk port(Tag:C)}
> > > end
> > > proc {Send P M}
> > > Ms Mr in
> > > {Exchange P.Tag Ms Mr}
> > > %%% point C
> > > Ms = M|Mr %%% point D
> > > end
> > > in
> > > P = {NewPort S}
> > > {Send P 1} %%% point A
> > > {Send P 2} %%% point B
> > > end
> > >
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users