> On Jun 9, 2019, at 8:11 PM, Dmitry Boyarintsev <[email protected]>
> wrote:
>
> 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.
> or
> declaring
> function myFunc(var a: array of integer): integer;
> is 100% not the same as
> TArrayType = array of Integer;
> function myFunc(var a: TArrayType ): integer;
>
What if static array and record types were the exception? I agree it looks bad
using anonymous records in parameters but pointers makes perfect sense to me. I
think simply allowing pointers (and perhaps dynamic arrays) covers 99% percent
of use cases.
Personally I’ve had to write dummy types more than once in order to get around
this design problem. If I had to guess I’d say this is just a historical relict
the didn’t stand up to the test of time.
Regards,
Ryan Joseph
_______________________________________________
fpc-devel maillist - [email protected]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel