[fpc-pascal] Interface syntax: Is possible don't use specialize in mode objfpc?

Michael Van Canneyt michael at freepascal.org
Thu Jul 16 23:44:36 CEST 2015



On Thu, 16 Jul 2015, Maciej Izak wrote:

> 2015-07-16 17:23 GMT+02:00 Sven Barth <pascaldragon at googlemail.com>:
>
>       Then let me tell you that generic methods will arrive in mode ObjFPC (and thus its syntax) first, because the Delphi syntax is a PITA to parse/handle.
>
>       (in fact generic methods are already working in mode ObjFPC in my local repo, I just want to get the Delphi ones working a little bit before commiting to trunk)
> 
> 
> @Sven, @Michael
> 
> I am using generics all the time for many things.
> 
> IMO using "generic/specialize" syntax because it is more simple to implement in compiler is very strange motivation. Using specialize keyword maybe is good in pure theory but is non practical
> (generic keyword in type declaration is not so bad).
> 
> You can torture me (!!!) but I will not use so many unnecessary words for simple things.
> By using this complicated syntax you will kill all functional/generic approach.

No problem. Use mode Delphi then, that's what it is for.

<sarcasm>
Why bother with mode objfpc ? It only makes life more difficult. 
You need to use @ when there is no need really, you are restricted in your choice of names. 
Why use it at all ?
</sarcasm/>

And you are discussing with the wrong person. I don't think generics are very useful to begin with.
I can see a use case for a simpler declaration of collections, but that's about it.

Silvio mentioned his company is moving to Node.js. That means Javascript. 
I program Javascript myself. 
Javascript is an unbelievably primitive language, yet is is increasingly popular.

To me, that tells me that all these additions to Object Pascal which everyone claims 
are 'so essential' are in fact pure nonsense. Eye candy to make it look modern.

Michael.



More information about the fpc-pascal mailing list