Thread View: comp.lang.lisp.mcl
1 messages
1 total messages
Started by Douglas C. Merrill
Thu, 21 Jan 1993 20:42
Nasty interaction of toplevel and menu-items
Author: Douglas C. Merrill
Date: Thu, 21 Jan 1993 20:42
Date: Thu, 21 Jan 1993 20:42
67 lines
2804 bytes
2804 bytes
Hi to all...
I've been working on a small program that replaces the toplevel loop with one
of my
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)
(%set-toplevel 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
:menu-title "Test"
:menu-items
(list
(make-instance 'menu-item
:menu-item-title
"Breaks"
:menu-item-action
#'(lambda ()
(test))))))
(menu-install *stupid-menu*)
I don't have any good ideas about what's going on -- maybe I'm confused about
the
various streams? Advice would be gratefully appreciated.
Thanks,
Douglas Merrill
Visiting Scholar
The Institute for the Learning Sciences
Northwestern University
1890 Maple Ave
Evanston IL 60201
dmerrill@ils.nwu.edu
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads