[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: a listener that won't listen
- To: mts@cs.toronto.edu (Martin Stanley)
- Subject: Re: a listener that won't listen
- From: bill@cambridge.apple.com (Bill St. Clair)
- Date: Tue, 31 Jan 1995 11:24:52 -0500
- Cc: bill@cambridge.apple.com (Bill St. Clair), info-mcl@digitool.com
- Sender: owner-info-mcl@digitool.com
At 10:08 PM 1/30/95, Martin Stanley wrote:
>What happens if (toplevel) is not executed? I fixed my code to do a
>set-toplevel, but did not do this and it seemed to work.
(toplevel) is basically a throw to a loop in the MCL kernel.
If your top level function is not itself a loop, then (%set-toplevel ...)
alone will work, since your code will return to the kernel loop.
MCL's toplevel-loop fucntion IS a loop, hence to change the toplevel
once you've entered toplevel-loop, you MUST execute (toplevel).
To clarify, the MCL kernel contains a loop that is effectively:
(loop
(catch :toplevel
(let ((cmain (%set-toplevel)))
(if cmain
(funcall cmain)
(clean-up-and-exit-to-shell)))))
And the toplevel function could be defined as:
(defun toplevel ()
(throw :toplevel nil))