Commit Graph

5 Commits

Author SHA1 Message Date
Ludovic Courtès 2b0a370d00
repl: Return stack traces along with exceptions.
* 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-19 15:14:08 +01:00
Ludovic Courtès f06a26f5b5
repl: Allow clients to send their protocol version.
* 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.
2020-03-19 15:14:08 +01:00
Marius Bakke ab7010af1f
gexp: Allow character literals in GEXP->SEXP.
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-12-18 22:36:37 +01:00
Ludovic Courtès 7abd5997f4
repl, marionette: 'self-quoting?' matches keywords.
* 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-09-23 23:41:19 +02:00
Ludovic Courtès 92a4087bf4
Add (guix repl).
* guix/scripts/repl.scm: Use (guix repl).
(self-quoting?, machine-repl): Remove.
* guix/repl.scm: New file.
* Makefile.am (MODULES): Add it.
2019-07-04 18:05:02 +02:00