|
|
|
|
|
by werner34
4579 days ago
|
|
I am a fan of python.
when developing python and needing a breakpoint I just write
>> import pdb;pdb.set_trace()
in the respective line and can then execute the code till that point and have all the current variables available in the console. This was missing for me when I started doing stuff in scala, so I hacked something to be able to do the same in Scala and jump straight to the REPL(unfortunately variables need to be passed explicitly here, but most of the REPL functionality works: https://gist.github.com/anonymous/7693857 |
|
I created a library a while ago that does something very similar to what you did, for the groovy language. http://aaronbabcock.blogspot.com/2011/11/groovy-debugging.ht...
It avoided having to pass in variables explicitly by using groovy's AST transform ability (macros) to examine the code for which variables would be in scope and pass those into the repl automatically. I wonder if something similar would be possible in scala?