I was reading here about using the breakIf method in the REPL code for interactive debugging, but then I found this post saying that break and breakIf were removed from ILoop in Scala 2.10. Unfortunately, that post doesn’t explain why the code was removed.
I’m assuming that these functions were removed because there’s a better way of doing this. If that’s the case, could someone please enlighten me?
Perhaps the idea is that you should just work with the
ILoopdirectly? As far as I can tell, it shouldn’t be much more complex than:Compared to the old
breakIfAPI, this approach gets rid of an additional level of indirection for both theifcondition (which was wrapped into a=> Boolean) and theDebugParam/NamedParam(which were temporary wrappers used only to fill in thebindarguments).This approach also allows you to specify your
Settingsas needed. For example, some REPL bugs can be worked around with-Yrepl-syncbutbreakgave you no way of specifying that.