<html>
<head></head>
<body>
1. pure function value to constants
<br>
<br> function foo(i:longword):longword; pure;
<br> begin
<br> foo:=9;
<br> end;
<br>
<br> const bar = foo( 8 ); //-- not allowed.. but i expect this to work!
<br> jar : longword = foo( 7 ); //-- and this as well
<br>
<br>
<br> 2. this does not end grasefully
<br>
<br> function foo (i:longword):shortstring; pure;
<br> var s : shortstring;
<br> n : longword;
<br> begin
<br> s:=''';
<br> for n:=1 to i do s:=s +'a';
<br> //-- not assing return value
<br> end;
<br> begin writeln(foo(9)); end.
<br>
<br> 3.
<br> function foo (i:longword):ansistring; pure;
<br> var s : shortstring;
<br> n : longword;
<br> begin
<br> s:=''';
<br> for n:=1 to i do s:=s +'a';
<br> foo:=s; //-- this makes function not pure, but why whould it!
<br> end;
<br> begin writeln(foo(9)); end.
<br>
<br>
</body>
</html>