trptcolin / reply

REPL-y: A fitter, happier, more productive REPL for Clojure.
Eclipse Public License 1.0
337 stars 44 forks source link

Multi-line form oddness in 'lein repl' #211

Open ingydotnet opened 1 year ago

ingydotnet commented 1 year ago
        ingy | technomancy: I noticed an oddity in `lein repl` yesterday. maybe nashi74 told you.
        ingy | https://gist.github.com/ingydotnet/cb11e16749495015056d285dee031b66
        ingy | not a big deal obviously but thought someone should know
 technomancy | ingy: ah, odd 
 technomancy | that would be handled by `reply` rather than leiningen directly; you can report it here: 
               https://github.com/trptcolin/reply
        ingy | https://gist.github.com/ingydotnet/33c35539c739a47b4b7a07ea3c09cad3 is clojure, 
               seems more normal eval order
        ingy | ok thanks
 technomancy | looks like just an issue with detecting the end of a form, right?
        ingy | no, it looks like in this situation it holds onto 1 complete form while waiting for the next
        ingy | EOFFBYONE ;)
 technomancy | right; like it mistakenly thinks the current form is incomplete 
        ingy | compare with https://gist.github.com/ingydotnet/e1791f9140f6da1240012b5e0297372d
        ingy | I thought it was a thing around the first line of a multilie 
        ingy | multi-line
        ingy | but it just holds one to 1 of them too long until the current line ends all forms
 technomancy | I mean the problem is it's going like "you gave me an incomplete form 
               so I'm going to wait till it's complete before evaluating anything"
        ingy | yeah not quite
        ingy | it;s like ok you didn't complete your forms but you did complete 3 of them, so I'll evaluate 2
        ingy | and keep 1 for myself for some reason I won't tell you ;0
 technomancy | gotcha
        ingy | :)     
ingydotnet commented 1 year ago

The repro case from https://gist.github.com/ingydotnet/cb11e16749495015056d285dee031b66 above:

user=> (prn
  #_=> 1)
1
nil
user=> (prn
  #_=> 1) (prn
  #_=> 2) (prn
1
nil
  #_=> 3) (prn
2
nil
  #_=> 4)
3
nil
4
nil
user=>