3 ms·
I'm not sure that macro in this submission shows that Go is better. Neither Go nor C has static assertions, the macro in questions uses clever techniques to im
by takeda 10y ago
I'm not sure that macro in this submission shows that Go is better.
Neither Go nor C has static assertions, the macro in questions uses clever techniques to implement one in C, but you probably can't do that in Go. So C is more powerful here.
Another example of clever C macro use is implementation of foreach loop (C doesn't have foreach) in linux kernel, here's question about it:
http://stackoverflow.com/questions/15754236/how-do-i-use-the-list-for-each-macro-in-list-h-from-the-linux-kernel-properly#15763938 http://stackoverflow.com/questions/15754236/how-do-i-use-the...