[fpc-devel] Thoughts on being able to declare "pointer-to-type" parameters directly in method signatures?

Ben Grasset operator97 at gmail.com
Mon Jun 10 03:26:16 CEST 2019


On Sun, Jun 9, 2019 at 8:37 PM Bernd Oppolzer <bernd.oppolzer at t-online.de>
wrote:

> the base type must have been declared already
>

Well, not necessarily in FPC, because generics, but that would just follow
the same way generic parameters are currently "filled in later" in all
other areas.

On Sun, Jun 9, 2019 at 8:37 PM Bernd Oppolzer <bernd.oppolzer at t-online.de>
wrote:

> if there is no definition for this pointer type, also in this case a new
> "artificial" type record must be built,
> but the type record should be inserted at the same level as the record of
> the base type. The generated
> name should be unique, not a normal identifier, and dependent from the
> base type identifier.
>

Presumably the compiler (in the case of FPC) would handle it roughly the
same way it currently handles stuff like:

var PI: ^LongInt

I do not believe it would be overly complicated to implement, in general.

On Sun, Jun 9, 2019 at 8:37 PM Bernd Oppolzer <bernd.oppolzer at t-online.de>
wrote:

> I am still not sure, if it is a good idea, because this would be an
> exception for pointer types;
> other type constructors like arrays, records, enumerations etc. are still
> not supported ...
> and it does not make sense IMO to support them.
>

 People keep saying this as though the *entire concept *of adding even the
smallest new thing syntactically to FPC is a completely new idea (which it
obviously is not.)
Adding this would *not *be any kind of notable "exception" in any practical
sense, unless you're holding FPC to a purely fictional standard for Pascal
that it does not actually currently follow in reality.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20190609/866d1085/attachment.html>


More information about the fpc-devel mailing list