<div dir="ltr"><div dir="ltr">On Fri, Jun 7, 2019 at 2:35 PM Jonas Maebe <<a href="mailto:jonas@freepascal.org">jonas@freepascal.org</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
None of these can be defined as a type in parameter lists. Keep in mind <br>
that "^Type" defines a new type. Semantically, it's at the same level as <br>
"0..5" and "record a, b: longint end;".<br></blockquote><div><br></div><div>Right, that's the point. There's nothing else that *would* make any syntactic sense in a parameter list besides "^Type" that isn't already allowed in them.</div><div><br></div><div>On Fri, Jun 7, 2019 at 2:35 PM Jonas Maebe <<a href="mailto:jonas@freepascal.org">jonas@freepascal.org</a>> wrote: <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Your "^Type" inline type definition would behave exactly the same as a regular pointer type definition.<br></blockquote><div><br></div><div> Of course. It would be strange if it didn't, I think. That's the whole point.</div><div><br></div><div>Here's another more simplistic example, in {$mode ObjFPC} this time:</div><div><br></div><div>program Example;<br><br>{$mode ObjFPC}<br><br>generic procedure GenProc<T>(Param: ^T); // <-- does not compile<br>var<br> P: ^T; // <-- compiles just fine<br>begin<br>end;<br><br>procedure NonGenProc(Param: ^LongInt); // <-- does not compile<br>var<br> P: ^LongInt; // <-- compiles just fine<br>begin<br>end;<br><br>begin<br>end.<br></div><div><br></div><div>To me it's always seemed illogical (in various different Pascal compilers over time, not just FPC) that the "parameter" declarations there don't work, whereas things like the "var" ones (which are just as "inline", I'd say) work just fine.</div><div><br></div><div>It comes across as the kind of thing that would happen if someone simply forgot to account for the "^" symbol in their code for parsing method signatures, not like any kind of intentional design choice.</div></div></div>