<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 10/06/2019 02:47, Ben Grasset wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAL4d7Fj8dagVL_N3n1FbqPR3R7jOpuR=A2mV0j8W_qNXNa8uMQ@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div class="gmail_quote">
<div>
<div class="gmail_quote">
<div>
<div class="gmail_quote">Yes? Obviously? I clearly
demonstrated the technical benefit in my original
comment. <b>Yet again </b>though I do not understand
why this is controversial. It would amount to a very
tiny syntax addition, that does <b>nothing </b>other
than make certain things <b>easier</b> to write. </div>
</div>
</div>
</div>
</div>
</div>
<br>
</blockquote>
Well a few points from my side. <br>
<br>
Your first post (if I have it right) was about generics:<br>
procedure MemCopy<T>(Dest: ^T; Src: ^T; Len: PtrUInt);<br>
A case in which the type is determined later, and you cannot
(easily) declare the pointer type in advance)<br>
<br>
To start with, I can see the appeal for that case.<br>
<br>
Problem 1: Overloading.<br>
<br>
program Project1;<br>
type<br>
Ta = type ^byte; <br>
Tb = type ^byte;<br>
<br>
procedure P1(x: Ta); overload;<br>
begin writeln(1); end;<br>
<br>
procedure P1(x: Tb); overload;<br>
begin writeln(2); end;<br>
<br>
begin<br>
P1(Ta(1));<br>
P1(Tb(1));<br>
end.<br>
<br>
If you did have "procedure P1(x: ^Byte); overload;", how would you
call it?<br>
<br>
Problem 2:<br>
pointer to pointer?<br>
This is not allowed in type:<br>
type PPFoo = ^^Foo; <br>
But what if you need it for a param?<br>
<br>
Problem 3:<br>
You stated (IIRC, somewhere in this thread), this was a special case
for pointers only. All the other types that can be declared are not
needing this.<br>
Well, that may be true for inline record declarations, though you
could call them with a constant:<br>
procedure P1(record a,b: Byte end); overload;<br>
and<br>
P1( (a:1; b:2) );<br>
<br>
Yes it is more far fetched. But gets closer with each step.<br>
<br>
The possible next step, if pointers would be agreed on, might be
sets. They are identical to the pointer issue. (At specialization T
must substituted by an existing enum)<br>
procedure Foo<T>(arg: set of T);<br>
The enum values of T are known, so this can be called.<br>
<br>
And to extend on this, if specialization can also take constants,
then ranges would be in the same category<br>
procedure Foo<A,B>(arg: A..B);<br>
Actually<br>
type TBar = class<br>
const A=1; B=5;<br>
end<br>
procedure Foo<T>(arg: T.A..T.B);<br>
<br>
So this is all, but limited to pointers.<br>
<br>
<br>
<br>
<br>
</body>
</html>