[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (read) reads an s-exp without Return

Hello, Honda-kun

> So, if anyone of you know how to change the behavior of read function
> to very ordinal one, which is, (read) function returns after hitting
> the return key, please inform me.

Yes! I had the same problem.  The following function (read-form) works fine.
This requires hitting the return key as the MACL toplevel. Of course, input
editing works well.

(defun read-form (prompt &optional (stream *terminal-io*))
 (let ((*listener-prompt-hook* #'(lambda () (princ prompt stream))))
   (ask stream (ccl::get-next-form))))

Takuo Watanabe : takuo@is.s.u-tokyo.ac.jp
Department of Information Science, Tokyo Institute of Technology