Hello,
I think gpc does not work properly when one gives a boolean function as a condition in repeat until loop. Please find an example below. I tested it on 2 different machines working under Linux and Darwin.
When you change
repeat until F1(a,b);
by
repeat x := F1(a,b); until x;
in procedure F2, then it works.
Greetings Artur
program tester;
function F1(a,b : string):boolean; begin writeln('F1(',a,',',b,')',length(a),' ',length(b)); F1:=true; end;
procedure F2(a,b : string); begin // writeln('F2(',a,',',b,')',length(a),' ',length(b)); //not necessary //when you add above, below works repeat until F1(a,b); //incorrect result repeat until F1('3','3'); //correct result //not necessary end;
var c: string; //not necessary
begin c:='1'; //not necessary repeat until F1(c,c); //correct result //not necessary F2('2','2'); end.
Remarks:
a) to have smaller example you can delete all lines with comment "not necessary" at the end of the line.
b) when F1 and F2 have only one parameter they seem to work.
Outputs:
Mac, Darwin Version: gpc 20030830, based on gcc-3.3.2 F1(2,1)1 1 F1(2,)1 1 // why the second printing is empty? F1(2,1)1 1
Intel, Linux gpc 20040516, based on gcc-3.3.1 artur@alioth:~> ./a.out F1(1,1)1 1 Segmentation fault artur@alioth:~>