[fpc-devel] Thoughts on being able to declare "pointer-to-type" parameters directly in method signatures?
Ben Grasset
operator97 at gmail.com
Fri Jun 7 20:26:55 CEST 2019
On Fri, Jun 7, 2019 at 1:47 PM Jonas Maebe <jonas at freepascal.org> wrote:
> It would be inconsistent to only allow such declaration for pointers,
> and not for other types (a programming language should strive to be as
> orthogonal as possible, with as few exceptions as possible).
>
I can't think of any particular variety of normal declaration *other* than
pointer aliases that aren't allowed in parameter lists, though.
As you said, "array of type" is fine (in all modes, I think.) In fact,
that's one of the reasons that the inability to use the "^" symbol in front
of a type for a pointer alias has always seemed like "missing"
functionality to me, as the fact that arrays can work like that makes me
think it's not unrealistic to implement the same kind of thing for pointers.
The "local procvar" thing is probably less common, but again it exists (and
only actually requires {$modeswitch NestedProcvars} I'm pretty sure.)
Apart from that, what else is there? Parameters can be records, classes,
objects, interfaces, function types, primitives, e.t.c.
There's no other type of alias I'm aware of that would make any sense by
itself (by which I mean, outside the context of an actual "type" block.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20190607/48170a6b/attachment.html>
More information about the fpc-devel
mailing list