logoalt Hacker News

saulpwlast Monday at 8:36 PM1 replyview on HN

I agree, some of the macros are very useful, and I've found myself wanting DO(n, code) as a simpler for-loop construct. In my own code, when I have some dozens of small things (like opcodes or forth words or APL operators), I specifically do want a "one-liner" syntax for most of them. The individual elements are usually so small that it's distasteful to spend 10 lines of code on them, and especially because the real understanding lies in the 'space between', so I want to see a large subset of the elements at once, and not put code-blinders on to focus on one element at a time.


Replies

uvaursilast Monday at 9:59 PM

In reading many C code bases, including the Linux kernel, every one finds a use case for macros of this nature.