janet-lang / janet

A dynamic language and bytecode vm
https://janet-lang.org
MIT License
3.52k stars 227 forks source link

format string %M inserts "..." #390

Closed andrewchambers closed 4 years ago

andrewchambers commented 4 years ago
Janet 1.9.0-dev-a73ba56  Copyright (C) 2017-2020 Calvin Rose
janet:1:> (printf "%M" (macex1 '(with [a b c])))
(do (def a b) (do (def _000000 (...)) (def _000001 (...)) (c a) (if (...) _000001 (...))))
bakpakin commented 4 years ago

M still limits recursion. Try %.99M

andrewchambers commented 4 years ago

Ah I see. Is there a documentation page on all the valid formats and how to use them? I feel like I've learned them in an adhoc way so maybe I missed a doc page.

bakpakin commented 4 years ago

Not directly, although since these patterns correspond to janet_panicf, this page has all of the escapes: https://janet-lang.org/capi/writing-c-functions.html