Fork me on GitHub
#parinfer
<
2015-11-26
>
onetom12:11:30

@snoe: yup, that's one of the things which were strange. but since it takes time and thinking and self-observation before i can ask well formed questions, i was hoping i could just get a better feeling for it from seeing some one else using it.

onetom12:11:34

we were test driving visual studio code, btw, so see if we can transition to it from sublime. the main motivation for the switch is the integrated git support with the great side-by-side, editable diff interface. until now not having any explicit clojure editing support was a show stopper, so i had high hopes for parinfer, but the learning curve has a non-obvious shape simple_smile

onetom12:11:52

@chrisoakman: if u haven't used paredit, how were u writing clojure before?

onetom12:11:27

our company just started using clojure about a year ago and the 1st ~6 weeks we did without paredit, but it was a major pain. we often fired up lighttable to fix unbalanced parens, because we used hoplon which compiled to clojurescript and it didn't throw any errors about certain paren unbalances and we just got an empty page... we used tabs for indentation to remedy this situation to some extent but then i bit the bullet and learnt paredit, figured out how to configure for sublime and since then we never looked back. the rest of the team picked it up in about a week or two too.

onetom12:11:20

it would still be a pain to worry about indentation, so since we found the lispindent sublime extension we hardly ever worry about indentation anymore. we have even switched back to spaces for indentation, though it makes using proportional fonts non-feasible... 😞

maxt13:11:45

I was surprised that parinfer didn't help me with "". Has there been discussions around that?

shaunlebron13:11:18

@maxt quotes are the bane of my work with parinfer

shaunlebron13:11:51

they simply cant be inferred like parens, because (a) multiline string conventions dont follow indentation rules and (b) quotes are non-directional so their contents can turn inside out if a single quote is typed behind them

maxt14:11:23

You're right, that's too bad 😞

shaunlebron14:11:56

i dont know how to fix it

shaunlebron14:11:29

if keyboards had directional quote keys, this wouldnt be a problem

shaunlebron14:11:36

imagine if we didnt have directional paren keys

maxt14:11:44

we'll just have to start writing qoutes like \`\` ''

maxt14:11:40

parinfer is not the only reason unidirectional quotes are poor

shaunlebron14:11:56

actually parinfer could handle them fine if it werent for semicolons

shaunlebron14:11:20

well parinfer could never infer quotes

shaunlebron14:11:35

but semicolons in strings or a single quote in comments actually break parinfer by causing intermediate states to be parsed by parinfer

shaunlebron14:11:42

by break i mean corrupt strings after quotes are typed one at a time

shaunlebron14:11:26

@maxt do you have any references on unidirectional quotes causing problems in other domains?

maxt14:11:45

No, sorry, I was mainly referring to that it makes it harder to read. Quotes where originally directed but that was simplified with the advent of the typewriter (well, I don't have a referrence for that either simple_smile ) In addition to that I've experienced many syntax-highlight errors in editors which probably could have been made less severe if it wasn't for the even/uneven issue

shaunlebron15:11:19

alright thanks

chrisoakman16:11:18

@onetom: before Parinfer I wrote Clojure like a caveman; manually closing parens and indenting everything by hand

chrisoakman16:11:15

that never bothered me, but it did seem to bother other Clojure developers who watched me 😉

chrisoakman16:11:33

now seems sort of crazy to write any Clojure without Parinfer

onetom16:11:25

but u had some matching paren indicator or how could u stand it? simple_smile

snoe17:11:05

maybe we can bind some keys to open and close quote to indicate to parinfer our intention and it rewrites them to the unidirectional "

snoe17:11:37

</brainstorm>

chrisoakman17:11:14

I used whatever Sublime Text does by default

shaunlebron17:11:44

@onetom what editor were you using that doesnt highlight matching parens? i thought most did that

onetom17:11:58

@shaunlebron: sublime has some limit built in regarding how many characters should it match parens across (for performance reasons) we wrote a lot of html equivalent code, so we crossed that limit often

shaunlebron17:11:05

@snoe im afraid we'd have to do something like that

onetom17:11:11

also sublime doesnt show extra parens either

shaunlebron17:11:49

oh that makes sense

shaunlebron17:11:36

vim has a "go to matching paren" key that i use all the time, i bet a sublime paredit plugin has that

shaunlebron18:11:10

@snoe i hope theres a better way, other than forcing editors to create a "view" for directed quotes, and then save the file with unidirectional, then re-infer directed quotes when opening

shaunlebron18:11:04

the simplicity of parinfer would be marred by this

snoe18:11:28

I agree, I suspect that there's probably a non-perfect answer though that will fail safe

snoe18:11:11

right now, I need to keep an eagle eye on my diffs 😛

shaunlebron18:11:21

@snoe im still thinking about your proposal to remove comments before transforming

shaunlebron18:11:25

but typing 'foo ;"' and prepending a quote would just never resolve

snoe18:11:19

hrm if we saved invalid states it's possible we could save the fact that the ;" is a comment

snoe18:11:45

for the record, I'd give up reversibility in comments if it preserved my code strings

shaunlebron18:11:10

that might have to be the compromise