chicken-janitors
[Top][All Lists]
Advanced

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

[Chicken-janitors] #721: read-string will drop last line if that line do


From: Chicken Trac
Subject: [Chicken-janitors] #721: read-string will drop last line if that line does not end with newline
Date: Wed, 26 Oct 2011 19:14:10 -0000

#721: read-string will drop last line if that line does not end with newline
----------------------+-----------------------------------------------------
 Reporter:  alanpost  |       Owner:       
     Type:  defect    |      Status:  new  
 Priority:  major     |   Milestone:  4.8.0
Component:  unknown   |     Version:  4.7.x
 Keywords:            |  
----------------------+-----------------------------------------------------
 The following program:

 {{{
 (let ((file (read-string)))
   (write file))
 }}}

 is a simple test of read-string.  The following does not produce the
 result I expect:

 {{{
 $ csi test.scm < test.scm
 "(let ((file (read-string)))  (write file))\n"
 }}}

 It appears if the newline in the middle of the file is not being
 preserved?  Further, if I remove the "\n" from the test.scm file (please
 find it attached, I used a program called bvi to remove it, most editors
 will not let you save a file with a missing final newline), I get:

 {{{
 $ dd if=test.scm bs=1 count=42|csi test.scm
 "(let ((file (read-string)))\n"
 }}}

 It seems the final line is being dropped!  What is going on here?  I
 expect read-string, when not given a size, to return my input file byte-
 for-byte?

-- 
Ticket URL: <http://bugs.call-cc.org/ticket/721>
Chicken Scheme <http://www.call-with-current-continuation.org/>
Chicken Scheme is a compiler for the Scheme programming language.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]