[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How do I write top level function?
- To: honda@csl.sony.co.jp (Yasuaki Honda)
- Subject: Re: How do I write top level function?
- From: co19c461@serc.3m.com (Paul L. Krueger)
- Date: Fri, 28 Sep 90 10:23:00 CDT
- Cc: info-macl@cambridge.apple.com
- In-reply-to: <9009280405.AA19611@scorpio.csl.sony.co.jp>; from "Yasuaki Honda" at Sep 28, 90 1:05 pm
>
> Could someone show me the good example of toplevel function which, at
> least, co-work with evaluation facilities provided by fred window?
>
> **************************************
> Yasuaki Honda
> honda@csl.sony.co.jp
> SONY Computer Science Laboratory Inc.
> **************************************
>
The following top-level function will let you do evaluation from fred
buffers. It makes use of functionality provided by the MACL developers.
I have not tested this extensively so there may be other problems, but
it will at least let you do eval-enqueues (which appears to be the
mechanism used by fred windows to force evaluation of expressions).
Hope this helps. Paul Krueger (plkrueger@serc.3m.com)
(defun simple-toplevel ()
(setq +++ nil)
(setq ++ nil)
(setq + nil)
(setq *** nil)
(setq ** nil)
(setq * nil)
(setq --- nil)
(setq -- nil)
(setq - nil)
(setq /// nil)
(setq // nil)
(setq / nil)
(loop
(catch :abort
(let* ((new-form (ask *terminal-io*
(ccl::get-next-form)))
(result (eval new-form)))
(if (eql :quit result)
(return-from simple-toplevel)
(print result))))))