You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This isn't a "issue", just an FYI. I'm not quite sure what specter-edn is used for, but I see that you are using rewrite-clj, and in the readme you are talking about formatting things. I expect that some of the contributors know about zprint since I recognize their names, but they (and you) might not know that the zprint library will directly format the zippers that rewrite-clj outputs. That is how it formats Clojure(script) code -- it uses rewrite-clj to parse the source, and then runs the formatting engine on the resulting zipper structure. There is a (currently hidden) option which will allow you to access this capability directly. I would be more than happy to make it a visible part of the zprint API if you wanted to use it. I didn't bother (so far) because I didn't think anyone would care. Which may well still be the case, but I thought I'd at least let you all know about it.
The option is {:zipper? true}. So, if you have something that is a rewrite-clj zipper which is the value of x, then this will format it to a string:
(zprint-str x {:zipper?true}
The entire zprint API will accept the :zipper? true key-value pair in the options map.
One possible problem is that zprint is using an old-ish version of rewrite-clj, and so there might be some incompatibility with the parsing output (or even the zipper implementation). If you are interested in using zprint, and you encounter problems because of the rewrite-clj version mismatch, I would be willing to move zprint to a more recent rewrite-clj (which is on my list of things to do anyway, but I would work on it sooner rather than later if it mattered to you).
Anyway, I thought that this might possibly be interesting to you, but if not, no problem.
The text was updated successfully, but these errors were encountered:
@kkinnear Thanks for this information, it will be useful. I have a project using zprint and specter-edn on the resulting string and I had no problem with incompatible rewrite-clj apis so far. I don't think there is need to rush on upgrading zprint. I will try the :zipper? true option later.
Formatting the output after the transformation will be a very nice feature to have.
@kkinnear actually, ignore the part about zprint and specter-edn working on the same project, that was my mistake and the rewrite-clj from zprint was shadowing the one from specter-edn.
This isn't a "issue", just an FYI. I'm not quite sure what
specter-edn
is used for, but I see that you are usingrewrite-clj
, and in the readme you are talking about formatting things. I expect that some of the contributors know aboutzprint
since I recognize their names, but they (and you) might not know that thezprint
library will directly format the zippers thatrewrite-clj
outputs. That is how it formats Clojure(script) code -- it usesrewrite-clj
to parse the source, and then runs the formatting engine on the resulting zipper structure. There is a (currently hidden) option which will allow you to access this capability directly. I would be more than happy to make it a visible part of thezprint
API if you wanted to use it. I didn't bother (so far) because I didn't think anyone would care. Which may well still be the case, but I thought I'd at least let you all know about it.The option is
{:zipper? true}
. So, if you have something that is arewrite-clj
zipper which is the value ofx
, then this will format it to a string:The entire
zprint
API will accept the:zipper? true
key-value pair in the options map.One possible problem is that
zprint
is using an old-ish version ofrewrite-clj
, and so there might be some incompatibility with the parsing output (or even the zipper implementation). If you are interested in usingzprint
, and you encounter problems because of therewrite-clj
version mismatch, I would be willing to movezprint
to a more recentrewrite-clj
(which is on my list of things to do anyway, but I would work on it sooner rather than later if it mattered to you).Anyway, I thought that this might possibly be interesting to you, but if not, no problem.
The text was updated successfully, but these errors were encountered: