PRINT function does not display anything prior to a READ function call
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Possible Issue: PRINT function does not display anything prior to a READ function call and variable assignment
Environment: 64-bit SBCL 1.3.15 running under 64-bit Windows 10 (version 1607) on my Dell XPS laptop (Intel Core i7-2720QM CPU, 8GB Ram).
I pass the following source file to SBCL using either --script or --load at the command line, and the PRINT function does not display anything prior to a read function call and variable assignment.
However, if I type something and press enter, then the PRINT function displays the missing text string on the same line as the hello-you function output.
-------
;;; Source file: lisp-tutorial_v1.cl
(print "What's your name?") ;; Does not work under SBCL! Works under Clozure CL.
(defvar *name* (read))
(defun hello-you (*name*)
(format t "Hello ~a! ~%" *name*))
(setq *print-case* :capitalize)
(hello-you *name*)
(quit)
-------
Example1: There's a blank line where I would expect the text "What's your name?" printed before entering John.
C:\src\00.lisp>sbcl --script "lisp-tutorial_
John
"What's your name?" Hello John!
C:\src\00.lisp>
-------
Example2: The same issue occurs when using --load rather than --script.
C:\src\00.lisp>sbcl --noinform --load "lisp-tutorial_
Jane
"What's your name?" Hello Jane!
C:\src\00.lisp>
-------
Example3: The PRINT function works under Clozure CL without any issue.
C:\src\
"What's your name?" John
Hello John!
C:\src\00.lisp>
-------
Use FINISH-OUTPUT.