[fpc-devel] Thoughts on being able to declare "pointer-to-type" parameters directly in method signatures?
skalogryz.lists at gmail.com
Mon Jun 10 02:11:22 CEST 2019
On Sun, Jun 9, 2019 at 6:29 PM Ben Grasset <operator97 at gmail.com> wrote:
> Again, literally nobody in this entire message chain has stated any actual
> reason why exactly they think it would be specifically *bad* to have
> `^Type` in method parameters.
Is it because parameter types are doesn't really match a type definition.
One can't do
function myFunc(var a: record a,b: integer; end): integer;
the record type has to be declared separately.
function myFunc(var a: array of integer): integer;
is 100% not the same as
TArrayType = array of Integer;
function myFunc(var a: TArrayType ): integer;
so parameter type declaration is pretty much "reserved" for Embarcadero to
change... and FPC will eventually follow :)
Ultimately the bad thing is changing Pascal ideology.
Declare first, then use.
Specifying a parameter type is "use". Thus it has to be declared first.
Do you really want to change it? If yes, what's the **technical** benefit?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-devel