[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Nasty interaction of toplevel and menu-items
- To: info-mcl
- Subject: Nasty interaction of toplevel and menu-items
- From: firstname.lastname@example.org (Douglas C. Merrill)
- Date: 21 Jan 93 20:42:21 GMT
- Newsgroups: comp.lang.lisp.mcl
- Organization: The Institute for the Learning Sciences
- Sender: email@example.com (Mr. usenet)
Hi to all...
I've been working on a small program that replaces the toplevel loop with one
own. However, I'm doing something wrong (aargh)! When I take over the loop,
anything typed into the Listener gets listened to correctly, but any function
called from a
menu-item that contains a (format t ) breaks in an odd way. Basically, it
looks like the
output of the format calls are being evaluated. So, if my menu calls a
function (test), and
test contains a call (format t "This will break"), my toplevel responds
> Error: Unbound variable: THIS
> While executing: SYMBOL-VALUE
> Type Command-/ to continue, Command-. to abort.
> If continued: Retry getting the value of THIS.
See the RestartsU menu item for further choices.
as if I had typed "This".
Code to produce this error is below:
;;;; Toplevel code to show break
;; set-top is an accessor function to set the toplevel routine
;; new-top is the new toplevel routine
(defun set-top (top-level-fn)
(throw :toplevel t))
(defun new-top (&aux form)
(format t "~&LISP> ")
(setq form (read))
(format t "~& ~a" (eval form)))
;; now just create the test case
(defun test ()
(format t "This will break"))
(defparameter *stupid-menu* (make-instance 'menu
I don't have any good ideas about what's going on -- maybe I'm confused about
various streams? Advice would be gratefully appreciated.
The Institute for the Learning Sciences
1890 Maple Ave
Evanston IL 60201