Re:Generics in C without void* or macros – enabled by psychec
by bluetomcat on Monday September 09, 2019 @10:58AM
(#20918790)
It seems to be aimed at quick prototyping of small programs, relieving you from declaring any structs or datatypes at all. The fields and layout of structs are inferred from the usage. With their frontend, you would be able to implement a type-generic list or a tree only with a few function definitions.
For each use of `prepend()`, their frontend defines an appropriate struct with fields `value` then `next` (in that order) whose types are inferred from the assignments in the body of the function.
Looking at their example:
For each use of `prepend()`, their frontend defines an appropriate struct with fields `value` then `next` (in that order) whose types are inferred from the assignments in the body of the function.