Fork me on GitHub

fun with calva's clojure lexer in a ts-node repl:

calva 3

That is cool! Reminds me that I did try to extract the lexer and more to an npm module some while ago. Got stuck on something, but there is this:


ah cool -- thanks for that. part of my motivation is to see if i can hook it up to some testing i'm doing of other similarish things.


> A Clojure Token Cursor. That's a bit terse. What is this?


Haha, yes, very terse. There’s a reason the version still is 0.0.1-test-4. Anyway, I think the token cursor goes back to an implementation of zmacs on some old Symbolic LISP Machine back somewhere between the 70s and the 80s. I think it still exists in emacs something like it as well. It’s a very nice way to navigate in LISP code, and powers about everything todo with s-expressions in Calva.


wow, totally didn't know the history!


after compiling to js, i patched together two of the files so i could run them in v8 inside of python:


Very cool. Why python?


here are some reasons: 1) test.check has a long-standing issue (the bind problem): -- apparently hypothesis does not have this issue 2) i am using it for tree-sitter-clojure which can be used from py-tree-sitter (not as easy to use tree-sitter stuff from clojure) 3) i was able to also get hypothesis to test parcera (which is clojure) via libpython-clj

👍 3
Jeff Friesen15:09:26

Has anyone been having trouble getting “format on save” working? I am so used to using that with Prettier in JS. I love it. But I can’t get it working in Calva. I’m using a vanilla Lein app template, REPL working and no linting errors. Format on Save is enabled. But saving the file doesn’t format it. Tab will format it. Any suggestions?


It is because the Calva formatter is a bit slow. VS Code only gives the extension so much time to perform the formatting. I think that we could get around it by adding a format-file-then-save command that the user can bind to the cmd+save. File an issue about it, please.

Jeff Friesen15:09:22

Ok, slow is relative I guess because using tab to format it is instant from a human perspective. But I get that it may not format before the save. Then the save kills that format command. I guess? I’ll file a ticket. Thanks


I might have analyzed the problem wrongly. It has been like this since I added the formatter to Calva.


Also, my experience is that Calva is so good at keeping the forms you edit formatted, that if it is a formatted file to begin with format-on-save doesn’t do anything most often. But ymmv.

Jeff Friesen15:09:33

Ok. I could see that for some people. Maybe its me that needs to get better at Paredit. I’ll make a ticket and you all can decide if you want it fixed or now. At the very least it will be on record for other people hitting the same problem. Thanks again


Is there any way to do the equivalent of clojure-thread-last-all from clojure mode in emacs?


No, we should add that too. Please file an issue, @alex395

👍 3