1
vote
1answer
179 views

What is this programming style? “Monoid-ic”?

In a moderately old blog post, Conal Elliot makes an interesting (if less than serious) argument that C is a purely functional language, by drawing a parallel between the combination of the C ...
2
votes
2answers
971 views

Why can't we declare 'extern C' for C++ macro's?

I am new to C/C++. Wanted to know why we cannot declare 'extern C' for C++ macro's similar to methods/functions...which will allow macro's defined in C++ file to be accessed in .c files. Thanks in ...
14
votes
1answer
1k views

Why does the C library use macros and functions with same name?

I am reading 'The Standard C Library' by PJ Plauger which is really interesting. The book explains not only how to USE the library but also how it is implemented. I have finished reading the ctype.h ...
1
vote
2answers
352 views

Using macro as an abstraction layer

I am having a discussion with a colleague about using macro as a thin (extremely) layer of abstraction vs using a function wrapper. The example that I used is Macro way. #define StartOSTimer(period) ...
16
votes
5answers
3k views

Are C++ templates just a kind of glorified macros?

From different comparisons among C++ templates and C#/Java generics like this one- ...
5
votes
3answers
838 views

Is macros support in a programming language considered harmful?

The first abuse that comes to my mind in C is: #define if while But at the same time it is extremely handy and powerful when used correctly. Something similar happens with Common Lisp macros. ...