3 ms·
I don't have experience with Ruby or Clojure. While you're debugging an app, can you step to a break point, evaluate the next statement, navigate back up the ca
by 0x445442 5y ago
I don't have experience with Ruby or Clojure. While you're debugging an app, can you step to a break point, evaluate the next statement, navigate back up the call stack, change code that's already executed and try again in those languages?
- vidarh 5y agoTo an extent. Things like "pry" in Ruby will let you edit methods and reload and resume and generally somewhat pretend you're working on an image. It's not as flexible as a typical Smalltalk environment, but with the new Ruby debugger in Ruby 3.1 I suspect we'll see another big leap towards that.
- phyrex 5y agoCommon Lisp lets you do that, but Clojure doesn't - I don't know about Ruby, but I expect not. That said, you have the wrong mental model. You don't run the whole program and set breakpoints. Instead you directly interact with your program-space. Imagine you have a function that retrieves something from an API. So you execute that function and see what it returns. You change that data around a little to fit your usecase, and then hand it off to the function that acts on the API result. That will produce more data; maybe this data is wrong, so you change the function, recompile it and load it into the program space, and try again with the same data you just changed (which is still right there in the variable you defined). Does that make it clearer?