Fork me on GitHub

Does anyone remember two small functions that i think Rich Hickey wrote? They would take a var and one would return the functions called from the function referenced by that var, and the other would find all functions that used that var. Does that ring a bell?


the functionality sounds sorta like codeq, , but it's not two small functions


yeah. i think there's some stuff. but i remember rich just tweeted them out or shared them here. And they were incredibly straightforward and smart, and did so much work that other tooling could accomplish with 1000s of lines of code

🆒 1

that sounds neat. hope someone can find a reference


i suspect i can think of 3 people who would probably know and hopefully they might remember if they see this


@U11BV7MTK I think something like that is built into REBL? I seem to recall some sort of dynamic call tree/var reference thing from that. I do remember part of the code being shared but I don't remember exactly where...


That includes some of Rich's code. Is that what you're looking for?


yes i think that is it!


and yeah it was when rebl came out and he was like "it's really not hard" haha. and bbatsov snapped it up and threw it into CIDER. it's got more nrepl stuff mixed in as well though


yeah that's what i mean. there's a LOT of work powering that. and this quickly just cranked it out in a very clever way


looks like a tip of the hat to java interop / jvm reflection


Are there any decent standalone tools for formatting EDN? Ideally available as a VSCode extension or in a website? I frequently find myself pulling and inspecting big single-line EDN structures out of logs. With JSON, I can just tell VSCode to format the document, but cljfmt (used by Calva) doesn’t break up lines, and it seems to struggle without an available REPL, and it seems silly to start a REPL just to format something


The Calva formatter is fully static, so no REPL needed. But yes, it does not break things up into lines.


Seems like there’s a niche for a standalone EDN extension with a formatter, or to allow calva to more aggressively format non-code


jet doesn’t care if it is code or EDN, does it?


I’m thinking a combo of jet + cljfmt might work nicely in Calva. (cljfmt would mainly make things adhere to whatever .cljfmt.edn rules in the project.


@max.r.rothman I think zprint does this (breaks into lines if it get too big), but it's a little hard to customize. Give it a try 🙂


there is also cljstyle which is like cljfmt but graal compiled so it boots fast (no repl needed)


@max.r.rothman There is jet which you can use like this: cat foo.edn | jet --from edn --pretty and it will pretty print the EDN. You can also apply a query or function to the incoming EDN. If you need additional formatting options perhaps use cljfmt, zprint , puget and the likes. Jet: I've got a puget CLI here:


Idea for a new clojure library `preach`, it goes and generates some generative tests for all your functions with `pre` /`post` conditions or those with a `spec` on them, and testifies that your code meets those invariants… 😄


Because I can never pass up a good pun

Lennart Buit20:11:09

There is this joke language named ‘vigil’. It’s a python dialect that outright deletes code that doesn’t adhere to its contract


that actually sounds kind of awesome….