R doesn't have much in the way of dynamic binding; you can fake it by
messing with environments, but that's not fun.
So instead, pass around the connection (`io') and an object
representing the SLDB state (`sldbState') to all functions.
Poor-man's explicit continuation-passing-style...
We need to call some of the mainLoop internal functions from elsewhere
now, so make them not-internal any more.
Fix ridiculous thinko in the logical branch of writeSexpToString
use simpleCondition rather than simpleError in swank:throw-to-toplevel
implement swank:debugger-info-for-emacs
Now `q' in sldb (sldb-quit) works. Things that don't work:
1. the backtrace is the wrong way up.
2. calling any restarts
3. frame locals
4. returning from frames (dunno if R actually supports this)
5. zoom to source
6. probably other things
We get far enough to start up a swank server in R and connect to it from
emacs; we get a REPL which formats the R-style results from parsing and
evaluating the input it receives. Debugging, stepping, documentation,
arglist and so on is basically entirely missing.