Fork me on GitHub
#parinfer
<
2016-03-05
>
snoe05:03:18

an observation from this week: (is= {:things [|1 :stuff :yup} (test-me args))

snoe05:03:43

Inserting the square bracket here does something surprising (unless you know the parinfer algo). It results in: (is= {:things [1 :stuff :yup (test-me args)]}) but it's actually easy to miss that test-me was slurped in, especially if you are just trying to wrap the 1 in brackets. It would be less surprising if the unbalanced [ had it's closing pair inserted before the }. (is= {:things [1 :stuff :yup]} (test-me args))

snoe05:03:48

As it stands, you need to find where the map used to end, and re-splice it (need to close ] and the }). With the suggestion you need only close the ]. I feel like I've been bit by this a few times.

snoe05:03:04

What do you guys think?

chrisoakman07:03:11

I have been bit by a similar variation of this

chrisoakman07:03:54

I would describe it Parinfer closing ending parens on the same line in not the place I want it to close

chrisoakman07:03:47

I'm not sure if the algorithm can be improved to deal with cases like this

shaunlebron15:03:37

that behavior sucks, I’ll look at it