[fpc-pascal] Constants in generics
florian at freepascal.org
Thu Nov 8 22:28:27 CET 2018
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 considered as a patch?
> I wanted to present the idea first before I spent any more time. Here’s what I has so far (on GitHub).
I like the idea of const in generics, but it needs serious cleanup when it's working:
- commit messages like "first commit" are useless
- do not commit meta files like .gitignore with a functional commit
- follow the indention style of the surrounding code
- the compiler contains already a type called tgenericdef
- do not change the lazarus project files best practice is, to make a local copy for your own work (like ppcx64_ryan.lpi)
- create tests: succeeding as well as failing one
- do not use c style operators in the compiler, use inc/dec instead of += and -=
- replace comments like // note: ryan by comments like: "check for const generic paramters"
More information about the fpc-pascal