Skip to content
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

join of two lists #321

Open
openvest opened this issue Oct 12, 2024 · 1 comment
Open

join of two lists #321

openvest opened this issue Oct 12, 2024 · 1 comment

Comments

@openvest
Copy link

Version
1.1.48

Symptom
joining two vectors works fine.
joining two lists returns a vector not a list

Reproduction

(let [s "'[(1) (2)]"
      pos  (pe/str-find-pos s 10)
      zloc (-> s
               (z/of-string {:track-position? true})
               (z/find-last-by-pos {:row 1 :col 7}))]
  (-> (paredit/join zloc)
      (z/root-string)))

Diagnosis
The source for paredit/join appears to have :vector hard coded in.

Action
Maybe just take the tag type of the right. Also maybe ensure they are both of the same tag type?

Less of a concern is that if there is not a whitespace, it appears to merge the two items e.g. [[foo][bar]] comes back as [[foobar]] not [[foo bar]].

I can git up a pr on this but I don't know if you would consider it a breaking change for some things.

Thx again repl-balance is near feature complete on paredit thanks to rewrite-clj!

@lread
Copy link
Collaborator

lread commented Oct 12, 2024

Thanks for the issue, @openvest!

I've got a bunch of paredit fixes in the hopper, and this happens to be one of them!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants