Hacker News new | ask | show | jobs
by alecco 5950 days ago
That's a good exception to the rule, but you have to admit it's not common.

I don't know the context of that source, so I can't make a proper reply to how to work around that. Is it really necessary to put it in the pre-processor? Does it change that often? Perhaps you can script it before pre-processing and compiling. It depends a lot on the design's context, this is probably a bad guess but the point is more often than not there are ways to avoid or minimize macro-hell scenarios, IMHE.

1 comments

I suppose it's a matter of taste, and I just look at C-style macros as a means to an end.

I suppose I think the fact it's not more common has to do with this knee-jerk reaction to avoid macros like some kind of plague.

Regarding your other point, I agree: at a certain point hacking up the DSL in perl or lisp is going to give enough greater flexibility that it's going to be worth the additional complexity (to the build system, documentation, programmer-requirements, etc).