Hacker News new | ask | show | jobs
by pogorniy 2019 days ago
When you write list, you can't know which of the structures are control and which are not (and why would you in the first place?). Because macroses can give any semantics, including control one, to the provided list. You think of the structures as lists, and care about narrative "all children of the list are at the same indentation level". That's where I find this "semantic formatting" a useful thing.
1 comments

I think your point might go to issues implementing a solution technically? Just in case it does...

It's only alluded to in this article, but Clojure has a semi-community-standardised metadata format [0] for indicating how a function should be indented. It isn't very impressive, and I'm not saying this is a solved problem because it isn't. I've never seen well indented lisp code in the way that Python is excellent. But the technical aspects of how to solve it are implemented, the answer is 'add semantic metadata to the functions, have a Well Known Standard for indenting code semantically'.

There is no reason in principle that Clojure couldn't have Python-good indenting except nobody seems to have any good ideas for how to format code usefully. Probably a style breakthrough waiting to happen.

[0] https://docs.cider.mx/cider/indent_spec.html