Hi Sven, Not to "debate" the syntax, but just ask :-)
1) in my second example: proc_ints: specialize ProcessArray<LongInt>; it is "specialized". Why this is still not consistent ? 2) in delphi mode, "specialize" is not required anywhere, right? If so, can you write an example of your new proposal in delphi mode? btw, my last experience with Delphi is 6 or 7, there was no generics yet. Thanks 2013/9/4 Sven Barth <pascaldra...@googlemail.com> > Am 04.09.2013 09:13, schrieb Xiangrong Fang: > > Thanks. This is sort-of too verbose when use. I have no comments > about how to define it, but when use it, can we just use: > > ProcessArray(someintarray); ? > > No. Generics are specialized with "<SomeType>", so not using it for > procedures/functions/methods as well is inconsistent. > > > > The complier should be able to "specialize" it implicitly because it > knows someintarray is array of integer? > > alternatively, how about this: > > var > proc_ints: specialize ProcessArray<LongInt>; > begin > proc_ints(someintarray); > end; > > use it without explicit specialize is best, however. > > No. In non-Delphi modes specializations require "specialize". This is for > consistency of the language and also for simplification of the parser in > those modes. > > And just in case: The syntax is not up to debate. > > Regards, > Sven > > _______________________________________________ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/mailman/listinfo/fpc-pascal >
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal