3 ms·
I suppose format strings can be transformed into a series of concatenation function calls. Or a single n-arity call. (format "{a} {b} cde {f}") Could be a m
by matheusmoreira 3y ago
I suppose format strings can be transformed into a series of concatenation function calls. Or a single n-arity call.
(format "{a} {b} cde {f}")
Could be a macro that returns:
(concat a " " b " cde " f)
The non-trivial part seems to be replacing the original format call site with the compiled version in the code. When I try to think it through, I conclude that everything should be a macro that outputs a compiled program. Just seems wrong in a dynamic language but it seems people do it all the time:
https://news.ycombinator.com/item?id=39240528 https://news.ycombinator.com/item?id=39240528
Partially evaluated programs.