News for hackers. Stuff that matters.
Re:Polymorphic Types in C [pdf] by uecker on Friday January 19, 2024 @02:41PM (#39060072)
Thanks. I agree that data structures are even more important. So I plan to make this for for data structures too (this is not a full proposal yet, just testing the waters):

#define foo(tag, T) struct tag { _Var(T)* p; }

then we also need a solution for the problem you mention. One option I thought about is to allow strings as tags: https://godbolt.org/z/cMc3aPjsK And if the builtin that transforms types to strings you be used as a string literal, this could work nicely. But even better may be to just all parametrizing the tag with a type: struct foo(T)

I am still thinking about this.

There are no comments on this comment yet.