Re: [fpc-pascal] Constants in generics

2018-11-08 Thread Ryan Joseph
I added const in declarations so you get syntax error. I also disabled the const’s in delphi mode because it does indeed break inline specializations. Not sure how difficult that will be to fix or if it’s even worth it since this feature isn’t in delphi afaik.

Re: [fpc-pascal] Constants in generics

2018-11-08 Thread Ryan Joseph
> On Nov 9, 2018, at 4:28 AM, Florian Klämpfl wrote: > > I like the idea of const in generics, but it needs serious cleanup when it's > working: > - commit messages like "first commit" are useless Those are for github so I could share but I need to learn SVN (again) eventually. > - do not

Re: [fpc-pascal] Constants in generics

2018-11-08 Thread Ryan Joseph
> On Nov 9, 2018, at 4:28 AM, Florian Klämpfl wrote: > > I like the idea of const in generics, but it needs serious cleanup when it's > working: Question: should other consts besides integers be allowed? I don’t think it makes sense personally to use strings, floats or sets but maybe I’m

[fpc-pascal] Restricted generic param types

2018-11-08 Thread Ryan Joseph
I’m getting a parse error here. It thinks the “U” is another type but in fact it’s another generic parameter and not related to “T” at all. Is this a bug? I don’t think the way the parsing works the compiler actually can discern this condition. {$mode objfpc} {$modeswitch advancedrecords}

Re: [fpc-pascal] Constants in generics

2018-11-08 Thread Florian Klämpfl
Am 06.11.2018 um 08:13 schrieb Ryan Joseph: > I implemented a first draft of constants (integers) in generics. My reason > was specifically that I wanted a way to add methods to static arrays and > generic records is the only way to accomplish this AFAIK. > > If I fix this up will it be

Re: [fpc-pascal] Restricted generic param types

2018-11-08 Thread Sven Barth via fpc-pascal
Am Fr., 9. Nov. 2018, 05:48 hat Ryan Joseph geschrieben: > I’m getting a parse error here. It thinks the “U” is another type but in > fact it’s another generic parameter and not related to “T” at all. Is this > a bug? I don’t think the way the parsing works the compiler actually can > discern

Re: [fpc-pascal] Constants in generics

2018-11-08 Thread Sven Barth via fpc-pascal
Am Fr., 9. Nov. 2018, 03:44 hat Ryan Joseph geschrieben: > > > > On Nov 9, 2018, at 4:28 AM, Florian Klämpfl > wrote: > > > > I like the idea of const in generics, but it needs serious cleanup when > it's working: > > - commit messages like "first commit" are useless > > Those are for github so