Re: "For" keyword not necessary, plus variable types maybe not necessary.



I don't think that would be a left linear grammar. So it would not compile in one pass. Making the compiler slower and more complex.

Among other things it would *** with peoples ability to read the code.

If your goal is stripping down symbols you could get rid of lots of stuff in theory. You don't need a var section. You don't need a begin keyword. You don't need ;s or :s. But compatibility, compilation efficiency and the legibility of your code would suffer....

procedure Main
vIndex
vIndex = 1 to 100
end
end


Skybuck Flying wrote:
Hello,

Following code could work:

procedure Main;
var
vIndex;
begin
vIndex := 1 to 100 do
begin

end;
end;

The to and do keywords should be enough for the compilers to figure out it's a for loop

The numbers indicate it should be some kind of integer so take the integer that will fit.

No need to write lengthy code like:

procedure Main;
var
vIndex : integer;
begin
for vIndex := 1 to 100 do
begin

end;
end;

Bye,
Skybuck.


.


Quantcast