3 ms·
I'm working within the premise of this library, which is to provides un-hygienic syntactic extensions to C via preprocessor macros, which are presumably suppose
by kazinator 8y ago
I'm working within the premise of this library, which is to provides un-hygienic syntactic extensions to C via preprocessor macros, which are presumably supposed to look reasonably good in comparison to Go.
Did you notice the #define end, which is a common name for struct members and local variables. Redefining select is certainly not a whole other level of inconsiderate in that light.
The caveat is that whoever uses this should include it last, after any other headers, and then deal with the macro clashes: don't use "choose" or "end" in their code and so on.
One way to mitigate this is to have these macros in a separate header, say "libmill-macros.h", so that the rest of the API is available without them.
- stingraycharles 8y agoYou’re suggesting creating incredibly fragile code that will cause a lot of cognitive overload which is completely unnecessary in the first place. Don’t do this, ever. Just because it’s technically possible doesn’t mean it’s a good idea.
- kazinator 8y agoI have no idea what you're talking about; we're discussing small, incremental changes in something whose design I have nothing to do with otherwise.
- jacoblambda 8y agothey are suggesting improvements. The code as a whole is problematic due to a number of reasons and they are offering improvements. If they had prefaced everything with add the namespace to the definitions, I doubt most people would have had as much of a problem with it. From what it seems, they didn't though because the developers don't seem to be worried about library namespace collisions.
- geezerjay 8y ago> You’re suggesting creating incredibly fragile code You're making ill-informed accusations. Please check libmill and pay attention to how it has been implemented, particularly the design choices covered in this thread, and afterwards re-read OPs comments.
- fao_ 8y ago> Did you notice the #define end, which is a common name for struct members and local variables. Redefining select is certainly not a whole other level of inconsiderate in that light. Local shadowing is completely different to global shadowing.