1. pure function value to constants function foo(i:longword):longword; pure; begin foo:=9; end; const bar = foo( 8 ); //-- not allowed.. but i expect this to work! jar : longword = foo( 7 ); //-- and this as well 2. this does not end grasefully function foo (i:longword):shortstring; pure; var s : shortstring; n : longword; begin s:='''; for n:=1 to i do s:=s +'a'; //-- not assing return value end; begin writeln(foo(9)); end. 3. function foo (i:longword):ansistring; pure; var s : shortstring; n : longword; begin s:='''; for n:=1 to i do s:=s +'a'; foo:=s; //-- this makes function not pure, but why whould it! end; begin writeln(foo(9)); end.
_______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel