Skip to content

Tinyscheme

Wojciech S. Gac requested to merge wsgac:tinyscheme into master

Hi,

I'm working on adapting Geiser to be able to use Tinyscheme. I've mostly been successful, getting completion and communication with REPL ready. There is one problem, however. My current implementation of geiser:eval (almost identical to the one for Chez Scheme) handles function calls correctly, but special forms such as (define ...) do not get properly evaluated, e.g. (geiser:eval #f '(define (double x) (* x 2))) runs fine, but trying to run (double 10) yields: Error: eval: unbound variable: double Perhaps you could suggest what I'm missing here. Below is my geiser:eval function:

(define (geiser:eval module form . rest)
    rest
    (let ((output (open-output-string))
	  (result (if module
                      (eval form (environment module))
                      (eval form))))
      (write `((result ,(write-to-string result))
               (output ,(get-output-string output))))
      (newline)))

Thanks

Merge request reports