[Openmcl-devel] patch: flush *terminal-io* when QUITting and other stuff

James Bielman jamesjb at jamesjb.com
Mon Jun 6 21:54:13 PDT 2005


I often have little scripts that I want to run with 'openmcl --load'
and I always forget that (quit) doesn't seem to flush terminal output
before exiting.  Here's a little patch that flushes *TERMINAL-IO*:

Index: l1-readloop.lisp
RCS file: /usr/local/tmpcvs/ccl-0.14/ccl/level-1/l1-readloop.lisp,v
retrieving revision 1.7
diff -u -r1.7 l1-readloop.lisp
--- l1-readloop.lisp	14 Mar 2005 11:58:52 -0000	1.7
+++ l1-readloop.lisp	7 Jun 2005 04:29:33 -0000
@@ -119,6 +119,7 @@
 			 #'(lambda ()
 			     (process-exit-application *current-process*
 				   #'(lambda ()
+				       (finish-output *terminal-io*)
 				       (#_exit exit-status)))))
       (unless (eq cp ip)
 	(process-kill cp)))))

Also, when I remember to try it, I've attempted to use the '--batch'
flag to get OpenMCL to quit after running a script, but I can't seem
to figure out how to use it.  Using 'openmcl --batch --load foo.lisp'
or so instead of writing '#+openmcl (quit)' would be handy.

Another startup thing---some time ago I tweaked my Lisp kernel to
remove the shortcut of using argv[1] (when argc is 2) as the Lisp
image name instead of -I when an embedded image is present.  I
couldn't figure out otherwise how to make a "standalone executable"
that took a single argument.

If this sounds like a good idea I can try to find that installation
and send a patch.


More information about the Openmcl-devel mailing list