Content deleted Content added
m →Use in school and higher education: Fixed figure caption |
Fixed typos and comments alignment |
||
Line 70:
In PascalABC.NET, functions are [[First-class citizen|first-class objects]]. They can be assigned to variables, passed as parameters, and returned from other functions. Functional type is set in the form <code>T -> Res</code>. An [[anonymous function]] can be assigned to the variable of this type:
<syntaxhighlight lang="delphi">
## // denotes that the main program will be written without enclosing
var f: real -> real := x -> x*x;
</syntaxhighlight>
Line 111:
begin
Down; //
SetSpeed(11); //
SetColor(Colors.Red); //
for var i:=1 to 450 do
begin
SetColor(RGB(128+i,0,i)); //
Forw(i); //
Turn(96); //
end;
end.
Line 145:
for var i:=a to b do
sum += i*i;
Print($'Sum = {sum}') // string interpolation
end.
</syntaxhighlight>
|