Skip to content

join of two lists #321

Open
Open
@openvest

Description

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!

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions