-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Review map-node vs namespaced-map-node #131
Comments
To remain compatible with rewrite-clj v0, we'll need to keep node layout the same. |
Another idea: make tag+ return namespaced keywords which can be used to build a hierarchy. (isa? :rewrite-clj/string :rewrite-clj/token) ;;=> true |
Thanks for the new idea @borkdude! For the uninitiated (and/or foggy-brained), in Clojure, we can define hierarchies via user=> (isa? :rewrite-clj/string :rewrite-clj/token)
false
user=> (derive :rewrite-clj/string :rewrite-clj/token)
nil
user=> (isa? :rewrite-clj/string :rewrite-clj/token)
true So rewrite-clj would provide finer-grained type information via a new Why do the keywords that are returned by An alternative might be to use Clojure's |
Moved from TODO note in docs in user guide.
Our map-node and namespaced-map-node model the structure of the source code.
This is convenient when navigating through nodes as one would through source.
But... when we want to logically treat any map as a map the difference is a bit awkward.
I was thinking a protocol for map nodes, but this would only be useful for the non-zipper (direct node) user:
(get-map-children n)
(replace-map-children n)
?So... not sure what might help.
In a previous experiment, I modeled all maps the same, but this made dealing the space that can occur after the namespaced map prefix inconsistent with the rest of the whitespace treatment in rewrite-clj.
The text was updated successfully, but these errors were encountered: