4 ms·
How is macros or metaprogramming or anything that fills a similar role?
by dustingetz 4y ago
How is macros or metaprogramming or anything that fills a similar role?
- sleepydog 4y agoNot great, not terrible; the language supports annotations which mean nothing to the compiler but which pre-processors can take advantage of, and there is a framework called ppx which you can use to write your own preprocessor. There exist many pre-processors to do things like add inline tests, generate getter/setter/pretty-printing functions, and so on. Here is an example: https://github.com/ocaml-ppx/ppx_deriving https://github.com/ocaml-ppx/ppx_deriving
- toolslive 4y agothere's BER MetaOCaml https://okmij.org/ftp/ML/MetaOCaml.html https://okmij.org/ftp/ML/MetaOCaml.html
- acchow 4y agoStill can't figure out what the BER stands for