Thanks Boriss for your informative reply.
I see that my problem lies at the understanding of
NewCell.
X = value
C = {NewCell X}
{Browse @C}
------------
If I replace value with 1,
I see 1 in the contect of C in the Browser.
If I replace value with 1|2,
I see "1"|"2" in the Browser.
If I understand you correctly, you are saying
that if value = 1|2|_future_,
then @C is the tail of this 'list'.
[ In fact, I try to put C as a local variable
and insert {Browse @C} at point A in the original snippet
and see no output in the Browser -- confirming the
your statement. ]
Now, the question is
in the original snippet,
when C = {NewCell S} is executed,
S is an unbound name,
how does the system decide whether S is
a variable, a list or a list_with_future ??
At which step in the snippet does the decision
occur ?
thanks
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
> >
> > ------------------------------------
> > At point A, S contains "1"|_
> > After point B, S contains "1"|"2"|_
>
> Hi HP
>
>
> Here is the confusion. When you sent 1 to the port in point A, you took
> the variable S out of the cell, bind it to 1|Mr and put Mr into the
> cell, then, Mr is the unbound tail of S.
> So, what you always keep in the
> cell, is the current unbound tail of S. I hope I can do a nice drawing
> of this.
>
> S = |
> / \
> 1 _ <---- C
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users