ECLiPSe with nested loops
From: Rory (rpd100_at__REMOVETHIS_york.ac.uk)
Date: 01/05/04
- Next message: Rory: "Re: ECLiPSe List to array conversion"
- Previous message: Bart Demoen: "Re: Java to Prolog and assert/retract"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 05 Jan 2004 22:16:24 +0000
Can someone explain why this doesn't work when you remove the comment??
%-------------------------------------
test(Z):-
X=1,Y=2,
(
for(I, 1, 3),
param(X,Y,Z)
do
(
for(J, 1, 4) ,
param(I,X,Y,Z)
do
(
for(K, 1, 5),
param(I,J,X,Y,Z)
do
(
%% append(X,Y,Z),
printf("I=%w, J=%w, K=%w, X=%w,
Y=%w%n", [I,J,K,X,Y])
)
)
)
).
%-------------------------------------
It breaks out of all loops upon executing the first line on the
innermost loop. Why? does "append(X,Y,Z)" evaluate to false? if so why?
Or more practically how does one iterate over a number of variables?
Any ideas people?
-Rory
- Next message: Rory: "Re: ECLiPSe List to array conversion"
- Previous message: Bart Demoen: "Re: Java to Prolog and assert/retract"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|