[fpc-devel] new features and facilities

Michael Van Canneyt michael at freepascal.org
Thu Oct 8 16:58:50 CEST 2015



On Thu, 8 Oct 2015, Mohsen wrote:

> Hi!
> I wanna add new features and facilities to pascal like while - else, for - 
> else and inline if statement like python.
>
> examples
>
> ex1:
>
> I:=5;
> while(I>0) do
>  begin
>     Write(I);
>     I:=I-1;
> end else Write(' While Else ');

This cannot be implemented without breaking the language.

I:=5:
If (I<5) then
  while(I>0) do
   begin
      Write(I);
      I:=I-1;
  end 
else
   Write(' While Else ');

Will not work correctly any more if you want to implement your idea.

So this extension is not possible without breaking backwards compatibility.

Michael.



More information about the fpc-devel mailing list