I hit a metal block when trying to understand
Figure 9.3 in chapter 9 in the Tutorial of Oz on the mozart web site.
Here is the snippet that I copied from Figure 9.3 (with irrelevant part
deleted).
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"|_
It is at the point C and D that I could not figure out what happened.
Suppose we are at point B when {Send P 2} is just invoked.
When the process reaches point C,
I thouhgt S should contain "1"|_
then Ms should be bind to "1"|_
and Mr is bind to "|_
and M is bind to "2"
Does the Exchange function do the exchange at this point ?
i.e.
S becomes "|_
what happens at point D ?
[ i.e. I don't follow the statement D with the above bindings!! ]
thanks
HP
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users