logoalt Hacker News

shahabaz1997 • today at 5:47 PM • 1 reply • view on HN

Question for the author: how does Sift decide indentation for user-defined macros? Since the right layout for a form like `with-foo` or `my-let` depends on how it is defined (body-style vs. plain call), I'd be curious whether you ship a fixed table of known forms, read indent hints from the source, or let users configure it per project. For a formatter that runs in CI, I'd guess predictability matters more than being perfectly right for every macro.


Replies

jjba23 • today at 6:44 PM

It's all three, in a fixed precedence order, plus a name-shape guess as the last resort. The chain is in `list-indent` in `src/sift/format.scm` (~L895).

On your CI point: yes, that's the stated priority. Nothing is inferred from how a form is used, there's no scanning of other files or dependencies, and the result is idempotent.