3 ms·
I supported those parentheses in the TXR Lisp pic macro: 1> (pic "##.#" 42) "42.0" 2> (pic "(##.#)" 42) " 42.0 " 3> (pic "(##.#)" -42) "(42.0)" Th
by kazinator 2y ago
I supported those parentheses in the TXR Lisp pic macro:
1> (pic "##.#" 42)
"42.0"
2> (pic "(##.#)" 42)
" 42.0 "
3> (pic "(##.#)" -42)
"(42.0)"
The ### notation, may be imediately preceded by a parens, which must be matched by a closing one. Both parentheses become spaces for a non-negative value, or are rendered for a negative one.
The notation is mutually exlusive with the + for requesting an explicit positive sign:
4> (pic "(+#.#)" -42)
"(-42.0)"
5> (pic "(+#.#)" 42)
"(+42.0)"
:)
The parens have become just literal text.