3 ms·
Reading the commentary on whitespace, my thoughts immediately jumped to the C preprocessor. Even though it's built into the language, it has the same sorts of p
by mschaef 8y ago
Reading the commentary on whitespace, my thoughts immediately jumped to the C preprocessor. Even though it's built into the language, it has the same sorts of problems as a template engine has with generating YAML: the preprocessor just wasn't enough aware of the syntactic structure of the language to make it easy to generate anything of significant complexity.
I'm not proud of this (and like to think I could come up with something better these days), but this code was a bit of a nightmare for that reason:
https://github.com/mschaef/vcsh/blob/master/vm/number.c#L256 https://github.com/mschaef/vcsh/blob/master/vm/number.c#L256
Lisp macros do better, but they have the problem that the macros (and their potentially unusual evaluation rules) can easily just blend in with ordinary function calls.