summary |
shortlog | log |
commit |
commitdiff |
tree
first ⋅ prev ⋅ next
Christophe Rhodes [Thu, 9 Sep 2010 22:28:11 +0000 (23:28 +0100)]
slightly more working inspector
Use an environment for istate rather than a list
implement swank:inspector-nth-part and swank:inspect-nth-part
Christophe Rhodes [Thu, 9 Sep 2010 15:31:17 +0000 (16:31 +0100)]
implement `swank:quit-inspector`
Christophe Rhodes [Thu, 9 Sep 2010 09:38:53 +0000 (10:38 +0100)]
the beginnings of an inspector
Implement enough that C-c I begins to work, at least for values like
list(1,2,3). The resulting inspector on the emacs side apparently has
no features, and an error message results on quitting the inspector
because I've only implemented `swank:init-inspector`, and not
`swank:quit-inspector`. Still, good enough to checkpoint.
Christophe Rhodes [Tue, 7 Sep 2010 07:38:19 +0000 (08:38 +0100)]
implement withRetryRestart
Use it in swank:interactive-eval and swank:eval-and-grab-output
Christophe Rhodes [Tue, 7 Sep 2010 07:27:59 +0000 (08:27 +0100)]
implement withOutputToString
Possibly, anyway. I think the semantics are right. Use it in
printToString and in swank:eval-and-grab-output.
Christophe Rhodes [Fri, 3 Sep 2010 16:03:08 +0000 (17:03 +0100)]
swank:value-for-editing and swank:commit-edited-value
These are (in principle, at least) really, really easy.
Christophe Rhodes [Fri, 3 Sep 2010 07:10:09 +0000 (08:10 +0100)]
alternative printing for the REPL
instead of using print(), use str(). Also, be even more cautious
about cleaning up in printToString; previously, errors in printing
would lead to a sink to a closed fifo...
Printing is still not really right, and I forsee that we will end up
writing our own printer to get something more lispy. But at least
this approach tends not to dump huge tables into the REPL.
Christophe Rhodes [Fri, 3 Sep 2010 07:07:43 +0000 (08:07 +0100)]
integrate into R's event loop, possibly
in readPacket, call socketSelect() before actually trying to read on
the connection. This seems to allow R to update graphics windows and
other such niceties.
It would be nice to be able to preserve the (inferior) R REPL as well,
but I haven't yet discovered whether that's possible.
Christophe Rhodes [Wed, 1 Sep 2010 10:11:52 +0000 (11:11 +0100)]
implement swank:find-definitions-for-emacs
A simple implementation, only looking for a single function
definition (no methods, whether S3 or S4, or indeed anything else).
Enough to support M-., though.
Christophe Rhodes [Wed, 1 Sep 2010 10:11:06 +0000 (11:11 +0100)]
use srcfile$wd when going to source for an sldb frame
it worked before while emacs and R were started with the same working
directory; this is not always going to be the case.
Christophe Rhodes [Tue, 31 Aug 2010 08:02:14 +0000 (09:02 +0100)]
support swank:clear-repl-results in swank-presentations
This makes my worry about lacking weak hash tables a bit less
pressing.
Christophe Rhodes [Tue, 31 Aug 2010 07:54:54 +0000 (08:54 +0100)]
initial implementation of support for REPL presentations
There's a lot here that's ugly, unfinished or just downright horrible.
Most notably, presentation support depends on swank-side read-time
evaluation (indicated with Common Lisp syntax, which hilariously is a
comment in R). We can't support that in general, but we can
special-case the presentation-specific operator.
But then the next difficulty comes along; actually performing that
read-time evaluation needs to happen in a different environment than
the evaluation of the REPL form. In order to achieve this, we abuse
bquote() the equivalent of Lisp's backquote facility, by calling what
in CL terms would be its macro-function on the parsed, preprocessed
expression; only after doing that (and hence resolving the `read-time'
evaluations) do we evaluate the call itself.
The implementation of presentation protocol messages is also slightly
ugly; having to implement cl:nth-value is particulraly horrible, but
the lack of weak references / weak tables in R (at least as far as I
can tell at the moment) is a cause of niggling concern.
Christophe Rhodes [Mon, 30 Aug 2010 20:45:48 +0000 (21:45 +0100)]
A proper implementation of swank:swank-require
We can do this nicely now that we have an evaluator of :emacs-rex
forms that can cope with quote.
Christophe Rhodes [Mon, 30 Aug 2010 20:42:59 +0000 (21:42 +0100)]
implement a mini code-walker to support nested function calls in :emacs-rex
This is all a bit horrible, but probably limited in maintenance headaches.
Christophe Rhodes [Mon, 30 Aug 2010 18:55:59 +0000 (19:55 +0100)]
make swank:listener-eval be a bit more like the CL version
don't return (:ok (:values "string")); instead, send a separate
(:write-string "string" :repl-result) and return (:ok ())
Christophe Rhodes [Mon, 30 Aug 2010 09:03:42 +0000 (10:03 +0100)]
use an environment holding the Slime I/O connection
Rather than having a bare io argument everywhere, encapsulate it in an
environment. (An environment is just about the only thing I can find
in R that isn't copy-on-write; this isn't helpful for the i/o
connection, but will be once we start implementing inspectors and
presentations...)
Christophe Rhodes [Sat, 28 Aug 2010 19:18:14 +0000 (20:18 +0100)]
slightly clarified the relationship to ESS
In particular, be careful not to overclaim. Motivated by preparing to
announce to the ESS mailing list.
Christophe Rhodes [Thu, 26 Aug 2010 10:39:18 +0000 (11:39 +0100)]
add README
Christophe Rhodes [Thu, 26 Aug 2010 10:36:30 +0000 (11:36 +0100)]
Add licence information to swank.R
Same terms as R itself: GNU GPLv2 or later version
Christophe Rhodes [Wed, 25 Aug 2010 17:14:38 +0000 (18:14 +0100)]
implement swank:frame-source-location
Now v in the debugger mostly works.
Christophe Rhodes [Wed, 25 Aug 2010 17:14:19 +0000 (18:14 +0100)]
factor out backtraceForEmacs() into `swank:backtrace`
write `swank:debugger-info-for-emacs` out, and hence delete
debuggerInfoForEmacs().
Now wandering past the --more-- prompt in sldb gives an infinite
sequence of NULLs, but at least it's not a cascade of errors any more.
Christophe Rhodes [Wed, 25 Aug 2010 14:57:56 +0000 (15:57 +0100)]
implement swank:interactive-eval and swank:eval-and-grab-output
This allows C-c : and C-u C-c : to work, modulo the printing of an
unnecessary [1]. The evaluation semantics of R are not what a Lisper might
expect; printToString(eval(parse(...))) does not necessarily perform the
evaluation before altering the output stream with sink() -- so capturing
all sorts of incidental output if something goes wrong.
This commit brought to you using C-c C-c.
Christophe Rhodes [Wed, 25 Aug 2010 14:55:41 +0000 (15:55 +0100)]
ensure that the fifo is closed in printToString()
Whoops. Good to know that I can make the same basic stream mistakes
in any language.
Christophe Rhodes [Tue, 24 Aug 2010 17:06:48 +0000 (18:06 +0100)]
implement swank:compile-string-for-emacs
As long as my defun-prompt-regexp is set up right, I can now use C-c
C-c to develop swankr. Go me.
Christophe Rhodes [Fri, 20 Aug 2010 19:17:02 +0000 (20:17 +0100)]
implement swank:simple-completions
Probably fails as soon as slime and R disagree about what are token
constituents, or if an R token contains regexp metacharacters.
Christophe Rhodes [Fri, 20 Aug 2010 19:16:00 +0000 (20:16 +0100)]
stub for swank:operator-arglist
Christophe Rhodes [Thu, 19 Aug 2010 07:59:42 +0000 (08:59 +0100)]
return properly from sldbLoop()
Always emit a :debug-return message. The extra :sldb-return stuff in
swank.lisp is (I think) only needed for multiple threads.
Christophe Rhodes [Sun, 15 Aug 2010 15:46:13 +0000 (16:46 +0100)]
put abort restarts around the main and sldb loops
Also hide the abort restart imposed on us by the R interpreter itself,
which has the side-effect of aborting swank completely.
Christophe Rhodes [Sat, 14 Aug 2010 20:55:14 +0000 (21:55 +0100)]
The beginnings of a vaguely-useful sldb
Implement swank:frame-locals-and-catch-tags. There are problems:
1. it seems that some names can be present in an environment but not have
a value, causing eval to blow up;
2. the default printing routines aren't really adapted to the constraints
of rendering in sldb;
3. trying to display locals of some of the swank frames (perhaps anything
with a tryCatch or similar block?) causes R to complain about a promise
already in the process of evaluation;
4. (probably) other things I haven't yet found
Christophe Rhodes [Sat, 14 Aug 2010 20:12:20 +0000 (21:12 +0100)]
store calls and frames on entry to sldb itself
Rather than do complicated stuff to keep track of where we are in the
stack, simply store the interesting frames and calls in the sldb state
structure.
Christophe Rhodes [Fri, 13 Aug 2010 16:24:02 +0000 (17:24 +0100)]
implement swank:buffer-first-change
Simply stub it in, to stop things whining at me when I type into the
wrong window and edit a Lisp file (which happens to be in slime
mode...)
Christophe Rhodes [Fri, 13 Aug 2010 16:10:16 +0000 (17:10 +0100)]
return stack frames in slime's order (most recent first)
Christophe Rhodes [Fri, 13 Aug 2010 16:00:22 +0000 (17:00 +0100)]
get definitions (use of <-) to work in the REPL
the REPL now evaluates with envir=globalenv(), rather than in the
environment of `swank:listener-eval`...
Christophe Rhodes [Fri, 13 Aug 2010 15:03:51 +0000 (16:03 +0100)]
support invoking restarts from sldb
Christophe Rhodes [Fri, 13 Aug 2010 14:22:58 +0000 (15:22 +0100)]
use a restart description for restart printing, if available
Christophe Rhodes [Fri, 13 Aug 2010 10:49:48 +0000 (11:49 +0100)]
rework to support sldb
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
Christophe Rhodes [Wed, 11 Aug 2010 14:58:47 +0000 (15:58 +0100)]
implement swank:throw-to-toplevel
Christophe Rhodes [Wed, 11 Aug 2010 14:02:47 +0000 (15:02 +0100)]
include swank.R hacks from today
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.