clojure-dev 2023-10-11

Is there a way to see the output of LispReader's reading a given form?

The output is what it returns?

I guess I mean, can I inspect the Read part of "REPL" before it's passed to eval?

You want a side channel of reader output

In that case, no there is nothing built into the reader where you can ask it to send another copy of the output somewhere else

👍 1

Depending on what you are doing clojure's repl is pretty modular and you could swap in either a custom read or custom eval

prepl might already do something like that

👍 1

so the repl is just calling (clojure.main/repl-read (Object.) (Object.)) to read from stdin which returns the LispReader output, but I guess will be the same as calling (read-string "(+ 1 2)") , you can run both of those from the repl to look at the LispReader output

👍 1