|
|
|
|
|
by rwmj
2025 days ago
|
|
Missing the most important case: Some external library you need changes a function signature and you need to be able to compile against the old or the new library, eg: #if LIBVERSION >= 2
draw_point (2, 3, RED);
#else
set_color (RED);
draw_point (2, 3);
#endif
This is actually a case where the C preprocessor would be useful in many more languages. OCaml has cppo which is like a better cpp and is very useful for solving these sorts of problems. (https://github.com/ocaml-community/cppo) |
|