<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jul 16, 2015 at 2:21 PM, Michael Van Canneyt <span dir="ltr"><<a href="mailto:michael@freepascal.org" target="_blank">michael@freepascal.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span>On Thu, 16 Jul 2015, Marcos Douglas wrote:<br></span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span>On Thu, Jul 16, 2015 at 11:44 AM, Michael Van Canneyt<br>
<<a href="mailto:michael@freepascal.org" target="_blank">michael@freepascal.org</a>> wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span>
<br>
<br>
On Thu, 16 Jul 2015, Maciej Izak wrote:<br>
<br>
</span><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
sadly - no, only in Delphi mode. btw. this thing keep me away from objfpc.<br>
</blockquote>
<br>
<br></span><span>
That seems like a very strange reason to me.<br>
<br>
The fact that you must type 1 word in certain places keeps you from using an<br>
otherwise useful mode ?<br>
This word is there for clarity, It is meant to help you, to make explicit<br>
you are in fact specializing a new type.<br>
</span></blockquote><span>
<br>
Yes, but do you think this is more verbose unnecessarily? Because the<br>
syntax TFoo<T> (I mean this "<>") show us that is a generic, don't?<br>
<br></span>
The Lazarus also has some troubles with the code completion using this:<br>
TFoo = class(TInterfacedObject, specialize ICloneable<TFoo>)<br>
</blockquote>
<br>
Lazarus is not alone, even I have trouble with this :)<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Sometimes the IDE shows an error in interface declaration, but compiles.<br>
So, to not receive these errors I have to create a new type:<br>
<br>
TFoo = class; //forward<br>
<br>
IFooCloneable = specialize ICloneable<TFoo>;<br>
<br>
TFoo = class(TInterfacedObject, IFooCloneable)<br>
//...<br>
end;<br>
...making even more verbose.<br>
</blockquote>
<br>
Pascal is a verbose language. If you want terse, use C++ or something like it.<br>
<br>
The whole generics mess that Delphi made goes completely against the Pascal dictum that you must declare something before you can use it.<br>
<br>
To me, the above verbose construction makes absolute sense. It has been so since day 1:<br>
<br>
PRecord = ^TRecord;<br>
TRecord = record<br>
a : integer;<br>
next : PRecord;<br>
end;<br>
<br>
Michael.</blockquote></div><div><br></div><div>IMHO this could be decided via poll, because several users around the world are using FPC too. For example, in a polling, I would vote in less keywords, e.g: [+1 vote for: "TFoo = class(TInterfacedObject, ICloneable<TFoo>)" / "t.Add<LongInt>(2, 4);"] and [-1 vote for: "TFoo = class(TInterfacedObject, specialize ICloneable<TFoo>)" / "t.specialize Add<LongInt>(2, 4);"].</div><div><br></div><div>The more verbose a language becomes, and needs more keywords to do simple things, the more chances it has to be depreciated.</div><div><br></div><div>I use other languages too, like Java (Android) and JS (front-end / AngularJS), but here in our company we are testing and thinking about migrating a lot of our online structure to Node.js, because it is very productive and less burocratic. For while we are using a mix of Pascal (XE8/FPC 3) and Node.js via proxy + websocket, but the trend is to use only JS in front-end and back-end.</div><div><br>--</div><div>Silvio Clécio<br>My public projects - <a href="http://github.com/silvioprog" target="_blank">github.com/silvioprog</a></div>
</div></div>