Re: Procedural parameters
Sven Barth via fpc-pascal <[email protected]>
| Newsgroups | gmane.comp.compilers.free-pascal.general |
|---|---|
| Message-ID | <[email protected]> |
Am 15.12.2024 um 01:58 schrieb Hairy Pixels via fpc-pascal: > Forcing function types and pointers to be type declaration only is now > a limitation for generic procedures and should be reversed. No reason > to be following what some Borland engineer was doing in the 80’s when > it’s 2024. > > procedure DoThis<T>(param: ^T); > procedure DoThis<T>(param: function(a, b: T): Boolean); The point is that Object Pascal defines that function parameters and result types can only be named types. A use of type definitions would mean that the declaration in the interface section would be different from the one in the implementation section, because that is how Object Pascal works. Not to mention that changing this would lead to conflicts with the syntax for open arrays and dynamic arrays. Regards, Sven _______________________________________________ fpc-pascal maillist - [email protected] https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal