logoalt Hacker News

amboo7today at 10:10 AM1 replyview on HN

Agreed. For the others, I asked Claude to write a structural edit tool: s-expressions only, insert/replace/... When passed 'tree' it prints a file like

<line>: <s-expr .-separated path>

then eg when passed 'replace 2.1 "(+ x y)"' it returns a new file (as a list of s-exprs).


Replies

drob518today at 1:44 PM

I’ve been struggling with this. I use Clojure and clj-paren-repair has been helpful (https://github.com/bhauman/clojure-mcp-light/blob/main/src/c...), but it would be even better if the model could be taught to do structural editing, the same way I do in Emacs.

Do you have something in a public repository I can look at?

show 1 reply