4.2.2 Annotated examples
(defun run-strange-interactive-program-smartly (args) (with-open-stream (strange (run-program "strange-interactive-program" :input :stream :output :stream :error-output :output :wait nil :arguments (strangify-arguments args))) (loop (write-string (strangify-command (read-english-command *standard-input*)) strange) (write-line (smarten-up-response (read-strange-response strange)) *standard-output*))))This program has the following effects:
read-english-commandparses a natural language command.
strangify-commandturns the parsed English command into a command that is suitable for the strange program.
read-strange-responseparses the output from the strange program.
smarten-up-responseturns output from the strange program into a readable format.
Generated with Harlequin WebMaker