Hacker News new | ask | show | jobs
by NullPrefix 2214 days ago
Hey, it's pretty nice.

Reminds of the old adage - You never code in plain C, you need to first #define some macros and then you can proceed with metaprogramming

2 comments

Thank you! I'd much prefer to not have to use macros, but I tried to make the with/withif mimic what I wish was a real C statement.
Unless you are doing embedded programming.
Especially when you are doing embedded programming.

You think those GPIO registers are going to encode themselves?

Macros are the lifeblood of embedded C. I have a use case where I need to read, shift, and OR a value, then write back. If I need to do that for more than 1 thing, sure as shit I'll write a macro.