Simplify define-pretty macro
This pull request changes the pretty syntax parameter to an ordinary function that calls whatever function is in current-pretty. This removes the need for the #:default keyword in define-pretty, and as a result the #:let keyword isn't needed anymore either. This makes define-pretty macro uses a bit more readable since they can now use ordinary default function arguments and local definitions.
Oh, I think I did it that way to break the cycle, because pretty is actually not a function, but rather a shorthand for (unbox (current-pretty))?
https://github.com/sorawee/fmt/blob/master/core.rkt#L136
The fact that your PR passes the CI is puzzling to me though. Maybe things work and there's no need to break the cycle after all?
Yeah the cycle is fine. Indirection through the box is enough to break it. Though I am surprised it uses a box at all instead of a parameter.
I recall I benchmarked at some point and found box to be significantly faster? Not sure though.
Ah, that makes sense. Parameters have the overhead of thread cells to worry about.