[fpc-pascal] a proposal about "with" syntax

Marco van de Voort marcov at stack.nl
Sun Mar 17 13:53:20 CET 2013


In our previous episode, Sven Barth said:
> > I think having functions/procedures with no arguments callable with procedurename() is un-pascal-like as well, but it hardly bothers me that FPK allows it.  Just because I don't love it doesn't mean others don't.  (There is a lot of C like syntax that has creeped into FPK, but I assume that'S either because it was easy to implement and a few people wanted it, or because it made porting C stuff to Pascal easier).
> 
> The reason that FPC allows to call parameterless functions and 
> procedures with "()" is because Delphi (and maybe TP) allows it as well. 
> For procedure/function variables (in non-Delphi modes) it is required 
> however, because this way the compiler can know for sure that a procvar 
> is called instead of just being used as a normal variable.

>From what I remember TP doesn't, and it was to introduced first to FPC to
disambiguate using the returnvalue of a function as function result, or
calling that function recursively. IIRC TP couldn't use function result as
rvalue.

Later it turned out that Delphi also allowed it.



More information about the fpc-pascal mailing list