hylang / hy

A dialect of Lisp that's embedded in Python
http://hylang.org
Other
4.85k stars 368 forks source link

Repl history should cycle through top level forms #2007

Open allison-casey opened 3 years ago

allison-casey commented 3 years ago

It would be nice if HyREPL cycled through entire forms when looking through the history like IPython instead of just by line. It would make working in the repl a much nicer experience. So pressing up in a case like this:

=> (defn test [name]
... (print "Hello" name))
=> 

would get you

=> (defn test [name]
... (print "Hello" name))
=> (defn test [name]
... (print "Hello" name))

and not

=> (defn test [name]
... (print "Hello" name))
=> (defn test [name]
peaceamongworlds commented 3 years ago

The default Python repl seems to do the same thing. Would this not be solved by using the hy repl through something like hy-mode in Emacs, or using a hy kernel for IPython?

scauligi commented 3 years ago

Sure, but if we can make our REPL nicer on its own I think that's still worthwhile.