summaryrefslogtreecommitdiff
path: root/guix/repl.scm
AgeCommit message (Collapse)Author
2021-01-21repl: Fix exception handling for interpreted code.Ludovic Courtès
The 'stack' variable could be #f when code is interpreted, which in practice happens when running in "legacy" mode--i.e., when 'open-inferior' invokes "guile" instead of "guix repl". * guix/repl.scm (send-repl-response)[handle-exception]: Check whether STACK is true before passing it to 'stack->frames'. * tests/inferior.scm ("&inferior-exception, legacy mode"): New test.
2020-03-19repl: Return stack traces along with exceptions.Ludovic Courtès
* guix/repl.scm (repl-prompt): New variable. (stack->frames): New procedure. (send-repl-response)[frame->sexp, handle-exception]: New procedure. Pass HANDLE-EXCEPTION as a pre-unwind handler. (machine-repl): Define 'tag'. Bump protocol version to (0 1 1). Wrap 'loop' call in 'call-with-prompt'.
2020-03-19repl: Allow clients to send their protocol version.Ludovic Courtès
* guix/repl.scm (send-repl-response): Add #:version. (machine-repl): Make 'loop' an internal define with a 'version' parameter. Pass VERSION to 'send-repl-response'. Send (0 1) as the protocol version. If the first element read from INPUT matches (() repl-version _ ...), interpret it as the client's protocol version.
2019-12-18gexp: Allow character literals in GEXP->SEXP.Marius Bakke
Fixes <https://bugs.gnu.org/38628>. * tests/gexp.scm ("lower-gexp, character literal"): New test. * guix/gexp.scm (gexp->sexp)[self-quoting?]: Add CHAR? to the tested types. * guix/repl.scm (self-quoting?): Likewise. * gnu/tests.scm (marionette-shepherd-service)[self-quoting?]: Likewise.
2019-09-23repl, marionette: 'self-quoting?' matches keywords.Ludovic Courtès
* guix/repl.scm (self-quoting?): Add 'keyword?' and 'array?'; remove 'vector?' and 'bytevector?'. * gnu/tests.scm (marionette-shepherd-service) <start>: Likewise. <modules>: Remove (rnrs bytevector).
2019-07-04Add (guix repl).Ludovic Courtès
* guix/scripts/repl.scm: Use (guix repl). (self-quoting?, machine-repl): Remove. * guix/repl.scm: New file. * Makefile.am (MODULES): Add it.