Commonlisp Help Thu Sep 28 19:21:57 EDT 2006 Commonlisp ---------- There is no reasonably standard COMMONLISP, so HPCM hides the exact commonlisp it is using inside the hpcm_clisp program. The standard way of running a COMMONLISP solution interpretively is hpcm_clisp -I pppp.lsp This loads pppp.lsp into the interpreter and issues the `(main)' call. The programmer should write a `(defun main ...)' for a function that reads `*standard-input*' and writes `*standard-output*'. The output of this command is just what the `main' function writes to the standard output, and nothing more. The pppp.lsp file can be compiled via the command hpcm_clisp -c pppp.lsp and the compiled code can then be executed by hpcm_clisp -I pppp.fas Program Structure ------- --------- The following can be used as the structure of a pppp.lsp file: (defvar debug) (defun dformat (&rest r) (if debug (apply #'format t r))) (defun main (&rest r) (setq debug r) (loop (let ( (line (read-line t nil 'eof)) ) (if (eq line 'eof) (return)) (dformat "..." . . .) . . . )) (format t "..." . . .)) If the program is called with one or more arguments, the `debug' defvar is set non-nil, and `(dformat ...)' will do nothing. The program can be called with arguments by executing hpcm_clisp -I pppp.fas argument ... The `(read-line t nil 'eof)' expression will read a line and return it, but return the symbol eof if an end of file is encountered instead of a line. File: commonlisp Author: Bob Walton Date: See top of file. The authors have placed this file in the public domain; they make no warranty and accept no liability for this file. RCS Info (may not be true date or author): $Author: walton $ $Date: 2006/09/28 23:24:23 $ $RCSfile: commonlisp,v $ $Revision: 1.5 $