Open lread opened 3 years ago
Maybe copying those functions to a new name while deprecating the old ones works.
Yeah, thanks, I think they will get deprecated, I'll wait and see what new fns #70 introduce here.
Interesting also that we have (skip-whitespace f zloc)
. Having zloc
as the first arg is more the norm in zip API, and more thread-first macro friendly.
I agree that this is confusing. Am I correct that checking for :tag
is a safe way to get the exact node type? For example, I want to distinguish spaces and newlines but there doesn't seem to be a function that is checking for that, such as spaces?
or newline?
.
Yes, I don't think we documented :tag
as part of the public API, but you can safely use it.
Here's maybe some useful inspiration from cljfmt: https://github.com/weavejester/cljfmt/blob/f3ba8d4d26d3894acdc4875f8b24477c306a3f4b/cljfmt/src/cljfmt/core.cljc#L77-L87
Yes, I don't think we documented
:tag
as part of the public API, but you can safely use it.Here's maybe some useful inspiration from cljfmt: https://github.com/weavejester/cljfmt/blob/f3ba8d4d26d3894acdc4875f8b24477c306a3f4b/cljfmt/src/cljfmt/core.cljc#L77-L87
Interesting that they consider comment to be a line break.
Interesting that they consider comment to be a line break.
For their purposes, it might make sense: a comment always ends with a line break.
The zip API has fns:
whitespace?
- returns true if Clojure whitespacewhitespace-or-comment?
- returns true if Clojure whitespace or commentAll good. But... the zip API also has:
skip-whitespace
- which skips Clojure whitespace AND comments.skip-whitespace-left
- dittoWhile reading code that uses the above functions from the zip API, I get confused.
Perhaps we can clean things up a bit (without breaking the existing API) when we get to #70. If we can't do that we'll stress the oddity in docs.