[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/geiser-guile 90835ae 127/284: Guile: new evaluation strate
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/geiser-guile 90835ae 127/284: Guile: new evaluation strategy that really delimits stack frames. |
Date: |
Sun, 1 Aug 2021 18:29:30 -0400 (EDT) |
branch: elpa/geiser-guile
commit 90835ae8e3ad9763e1a8d1135e337c0855ec3daf
Author: Jose Antonio Ortega Ruiz <jao@gnu.org>
Commit: Jose Antonio Ortega Ruiz <jao@gnu.org>
Guile: new evaluation strategy that really delimits stack frames.
---
geiser/evaluation.scm | 32 +++++++++++++++++++++-----------
1 file changed, 21 insertions(+), 11 deletions(-)
diff --git a/geiser/evaluation.scm b/geiser/evaluation.scm
index 7f2b8f7..179e425 100644
--- a/geiser/evaluation.scm
+++ b/geiser/evaluation.scm
@@ -16,10 +16,10 @@
ge:compile-file
ge:load-file)
#:use-module (srfi srfi-1)
+ #:use-module (language tree-il)
#:use-module (system base compile)
#:use-module (system base pmatch)
#:use-module (system vm program)
- #:use-module (language tree-il)
#:use-module (ice-9 pretty-print))
(define (handle-error stack . args)
@@ -40,25 +40,35 @@
(beautify-user-module! m)
m))))
+(define (write-result result output)
+ (write (list (cons 'result result) (cons 'output output)))
+ (newline))
+
(define (ge:compile form module-name)
(let* ((module (or (find-module module-name) (current-module)))
(result #f)
(ev (lambda ()
- (set! result (call-with-values
- (lambda ()
- (start-stack 'geiser-evaluation-stack
- (compile form #:env module)))
- (lambda vs (map object->string vs)))))))
+ (set! result
+ (call-with-values
+ (lambda ()
+ (let* ((o (compile form
+ #:to 'objcode #:env module))
+ (thunk (make-program o)))
+ (start-stack 'geiser-evaluation-stack
+ (eval `(,thunk) module))))
+ (lambda vs (map object->string vs)))))))
(let ((output (with-output-to-string ev)))
- (write `(,(cons 'result result) (output . ,output)))
- (newline))))
+ (write-result result output))))
(define ge:eval ge:compile)
(define (ge:compile-file path)
- (ge:compile `(load-compiled (compile-file ,path
- #:canonicalization 'absolute))
- '(geiser evaluation)))
+ (write-result
+ (let ((cr (compile-file path #:canonicalization 'absolute)))
+ (and cr
+ (list (object->string (save-module-excursion
+ (lambda () (load-compiled cr)))))))
+ ""))
(define ge:load-file ge:compile-file)
- [nongnu] elpa/geiser-guile 4afe5ff 098/284: Guile: bug fix: evaluation works again (1.9.3 or better required)., (continued)
- [nongnu] elpa/geiser-guile 4afe5ff 098/284: Guile: bug fix: evaluation works again (1.9.3 or better required)., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile c8d63ff 073/284: Guile: bug fix (missing module import)., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 936a20e 074/284: Fixing the mess during initialization., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 4bc26f8 086/284: kludgy fix for opt/key/rest markers in autodoc, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile d5840a0 093/284: BSD relicensing: elisp code., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 236ec5f 096/284: Guile: define-module forms are now individually evaluable (e.g. using C-M-x or C-x C-e)., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile e8d1ca5 113/284: Guile: switch to REPL and module activated., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile c6248c4 119/284: Guile: evaluation output collection reactivated., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 503e239 137/284: Guile: tweaks to the previous fix., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 6212ff6 128/284: Guile: real fix for symbol locations (needs Guile's git head)., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 90835ae 127/284: Guile: new evaluation strategy that really delimits stack frames.,
Philip Kaludercic <=
- [nongnu] elpa/geiser-guile a15f00a 156/284: Dead code elimination, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 7ecebbc 160/284: Guile: xref commands working again, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile d5252a1 189/284: Guile: fix for the argument shortening algorithm, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile a77bf8b 193/284: Elisp buggettes and warnings, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 1eebcce 197/284: Guile reconnected (but not debuggable (yet)), Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile fa4e0bc 198/284: Guile reconnected (but not debuggable (yet)), Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 6d52afb 199/284: Better EOT token for more robust communication, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 2ea6d9d 204/284: Superior schemes, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 0d3b1f8 205/284: Support for implementation-specific font lock keywords, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 92dadf9 206/284: Typo, Philip Kaludercic, 2021/08/01