%% dataflow variables revisited:
local X Y Z in
X = 5
Y = 6
Z = X+Y
{Browse [X Y Z]}
end
local X Y Z in
Z = X+Y % will block forever (X and Y are not bound, "+" suspends)
X = 5
Y = 6
{Browse [X Y Z]}
end
local X Y Z in
thread Z = X+Y end % will wait until parent thread assigns X and Y
X = 5
Y = 6
{Browse [X Y Z]}
end
local X Y Z in
thread Z = X+Y end % will wait forever for Y
X = 5
Z = 6
{Browse [X Y Z]}
end
local X Y Z in
thread Z = X+Y end % after Y is assigned 1, it resumes execution:
% compatible assignment "6 = 6"
X = 5
Z = 6
{Browse [X Y Z]}
Y = 1
end
local X Y Z in
thread Z = X+Y end % after Y is assigned 2, it resumes execution:
% incompatible assignment "6 = 7" displays failure
% but store assignments remain X=5 Z=6 Y=2
X = 5
Z = 6
{Browse [X Y Z]}
Y = 2
end
% failures halt execution of a composite statement, e.g.:
local X Y Z in
thread
Z = X+Y % after Y is assigned 2, it resumes execution:
% incompatible assignment "6 = 7" displays failure
{Browse Z} % Z is not displayed.
end
X = 5
Z = 6
{Browse [X Y Z]}
Y = 2
end
local X Y Z in
thread
Z = X+Y % after Y is assigned 1, it resumes execution:
% compatible assignment "6 = 6"
{Browse Z} % Z is displayed.
end
X = 5
Z = 6
{Browse [X Y Z]}
Y = 1
end