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

Strange output error



I'm not sure if this is a Lisp error or an implementation error.

I have a function that reads a string from the keyboard which
has an optional parameter giving a prompt message.

This seems to work fine when called individually but in a sequence
of 3 or more calls it starts to display part of the prompt twice,
e.g.
> (read-unix-error 'filestore)
Enter application name> xfig
Enter the environment> csh
Enter error message> who
Enter problem description> 
blem description> d
Enter machine name> 
blem description> Enter machine name> d

(The 'Enter the environment>' is a separate function to read in a check
for a defined type)

The function definition is:

	(defun read-string (&optional (prompt "> "))
        	(fresh-line)
        	(format t "~a"  prompt)
        	(read-line)
	)

Does anyone have any idea why this is happening? I have to admit to not
being all that familiar with Common Lisp I/O so I may have made a
glaringly obvious error!

Thanks for any help,

David.

-- 
-=- -=- -=- -=- -=- -=- -=- -=- -=- -=- -=- -=- -=- -=- -=-
David Arnold                             (daa93@aber.ac.uk)
Dept. Computer Science                   +44 (0)970-622449
University of Wales,Aberystwyth, Dyfed SY23 3DB, UK.
http://www.dcs.aber.ac.uk/~daa93
GCS -d+ p c++@ !l e++ m+++(*) s+/- n+ h(-) f !g w- t+@ y? 
-=- -=- -=- -=- -=- -=- -=- -=- -=- -=- -= -=- -=-- -=- -=-