guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug in eval-string?


From: rm
Subject: Bug in eval-string?
Date: Thu, 8 Aug 2002 14:56:41 +0200
User-agent: Mutt/1.3.24i

Hello list,

according to the documentation, 'eval-string' 
evaluation "... takes place in the environment 
returned by the procedure interaction-environment".
Unfortunately this doesn't seem to work for me
(see the following test case):


 tia  Ralf Mattes

------------------------x--------------------------------

;; File: eval-test.scm
;; create an evaluation context
(define boxx (make-module))
(set-module-kind! boxx 'directory)

;; fill it with _some_ bindings
(module-define! boxx 'define define)

(eval '(define meaning-of-life 42) boxx)

;; test the bindings
(eval 'meaning-of-life boxx)

;; => 42

(let ((interaction-environment (lambda () boxx)))
  (format #t "Meaning of life in a box is: ~A\n"
          (eval-string "meaning-of-life")))

;; Backtrace:
;;  16: 1* (let (#) (format #t "Meaning of life in a box is: ~A " #))
;;  17: 2  [simple-format #t "Meaning of life in a box is: ~A " ...
;;  18: 3*  [eval-string "meaning-of-life"]
;; In unknown file:
;;   ?: 4*  meaning-of-life
;;
;; <unnamed port>: In expression meaning-of-life:
;; <unnamed port>: Unbound variable: meaning-of-life
;; ABORT: (unbound-variable)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]