Fork me on GitHub

Welcome @dave.dixon! 👋


Why does pr-str on a node yield something like <token: foo> rather than something which can be consumed by read-string? Not a big deal, but it can be confusing for tooling (like the Flow Storm Debugger) that seem to rely on pr-str for sending results.


By comparison, the result I get from the socket REPL using clover in VSCode looks like:

#rewrite_cljc.node.token.TokenNode {:value foo, :string-value "foo"}


I think @UG1C3AD5Z might have asked about that too, many moons ago. I think @UG1C3AD5Z was trying out REBL and details were maybe being hidden by this behaviour.


The VSCode rulest is what you get when printing in a defrecord. It seems rewrite-clj defines print-methods for its types here: Maybe those print-methods can be removed, not sure. It doesn't seem to be a good idea to define a print-method which prints something which cannot be read.


Right. Or if there's something useful about the <> representation, maybe have another method that outputs that. Probably not a priority right now, but might be nice to clean up at some point.


I’m not sure why the original author of rewrite-clj made that decision, and he has moved on to other things and not available. My original position was to avoid all unnecessary breaking changes when migrating to rewrite-cljc, but am now revisiting for things that just don’t make good sense.


> By default, pr and prn print in a way that objects can be read by the reader It seems to go against the spirit of pr/prn


Emitting something with a reader tag is probably a better way and then define data readers




I wonder if it was just to support the use of clojure.test, and save some keystrokes when defining tests. It's the only obvious place I find the <> notation used.


The reader-tag approach seems like a good alternative for that case.


I do have a set of popular projects that use rewrite-clj that I have tested against in the past. I could see if any of them are relying on this and in what way. I’ll raise an issue in rewrite-cljc to have a look at this.


Thanks for bringing it up @dave.dixon!


Huh! I guess I’d better get this sucker up on clojars sometime, huh? simple_smile


I like and use antq, I now use it instead of depot.


BTW @borkdude, I am working my way through an implementation of namespaced element support for rewrite-cljc - much of it as per our discussions. I think it is going pretty well.