Am Do., 3. Jan. 2019, 14:24 hat Alexander Shishkin via fpc-pascal < fpc-pascal@lists.freepascal.org> geschrieben:
> 03.01.2019 15:45, Mattias Gaertner via fpc-pascal пишет: > > On Thu, 3 Jan 2019 14:58:00 +0300 > > Alexander Shishkin via fpc-pascal <fpc-pascal@lists.freepascal.org> > > wrote: > > > >> [...] > >> This is OK (both T and U are integer): > >> generic TMyRecord1<const T, const U: integer> = record end; > > > > That is inconsistent to normal Pascal arguments. > > > > <accessors> Name[, Name ...][:type] > > > > Isn't it? > > > > I personally do not like const prefix either. More consistent with other > constraints would be: > > T and U integer const > generic TMyRecord1<T, U: integer> = record end; > generic TMyRecord1<T, U: const, integer> = record end; > > Similar to > generic TMyRecord1<T, U: IUnknown> = record end; > generic TMyRecord1<T, U: class, IUnknown> = record end; > > T and U any const > generic TMyRecord1<T, U: const> = record end; > > Similar to > generic TMyRecord1<T, U: record> = record end; > > And more complex example: > > generic TMyRecord1<T, U: record; X, Y: const> = record end; > I'm against that. A constant parameter is a different beast from a type parameter so requiring a special prefix for them is legitimate. Also this is more like the normal routine parameter syntax, thus everyone will feel right at home. Regards, Sven >
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal