Nested foreach
Posted: 16 Sep 2015 9:51
Hi,
I'd rather start a new thread about theconstruct instead of continue the "universal quantification http://discuss.visual-prolog.com/viewtopic.php?t=14323"
thread.
1) Are
A)
and
B)
equivalent?
I mean: Yes, they are.
The, constructs are newly added to the VIP syntax. I often add the illegal comma before the closing tag:
I'd rather start a new thread about the
Code: Select all
foreach...end foreach
thread.
1) Are
A)
Code: Select all
foreach nondetpred1(X) do
foreach nondetpred2(X,Y) do
foreach nondetpred3(X,Y,Z) do
procbody(X,Y,Z)
end foreach
end foreach
end foreach,
B)
Code: Select all
foreach nondetpred1(X),
foreach nondetpred2(X,Y),
foreach nondetpred3(X,Y,Z) do
procbody(X,Y,Z)
end foreach
end foreach
end foreach,
I mean: Yes, they are.
The
Code: Select all
foreach...end foreach
Code: Select all
if then ...else...end if
Code: Select all
foreach nondetpred3(X,Y,Z) do
procbody((X,Y,Z), % <=== syntax error
end foreach.