[fpc-pascal] Constants in generics

Sven Barth pascaldragon at googlemail.com
Sun Jan 6 09:28:17 CET 2019


Am Sa., 5. Jan. 2019, 22:57 hat Ryan Joseph <ryan at thealchemistguild.com>
geschrieben:

> Here’s the new syntax requirements for const params which require types
> and consts be separated by semicolons.
>
> Does TStuff2 need a ; between the two const params? Sven said consts must
> follow ; or < but they’re both consts so I thought I’d ask to make sure.
>
> type
>         generic TStuff0<A:TObject;T> = record end;
>         generic TStuff1<T;const A,B,C:integer> = record end;
>         generic TStuff2<const A,const B,C:string> = record end;
>         generic TStuff3<const A:integer;T> = record end;
>

Just think about it logically: B and C can't be anything else than const,
so why would we need to repeat it?

Regards,
Sven

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20190106/319cc351/attachment.html>


More information about the fpc-pascal mailing list