[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-janitors] #721: parley seems to drop newlines when piping i
From: |
Chicken Trac |
Subject: |
Re: [Chicken-janitors] #721: parley seems to drop newlines when piping input from stdin (was: read-string will drop last line if that line does not end with newline) |
Date: |
Wed, 26 Oct 2011 19:27:17 -0000 |
#721: parley seems to drop newlines when piping input from stdin
-------------------------+--------------------------------------------------
Reporter: alanpost | Owner: ckeen
Type: defect | Status: accepted
Priority: major | Milestone: 4.8.0
Component: extensions | Version: 4.7.x
Resolution: | Keywords: parley stdin pasting
-------------------------+--------------------------------------------------
Changes (by ckeen):
* status: new => accepted
* component: unknown => extensions
* owner: => ckeen
* keywords: => parley stdin pasting
Old description:
> 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?
New description:
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?
--
Comment:
parley is in use in alan's .csirc, so the problem has been rededicated to
parley
--
Ticket URL: <https://bugs.call-cc.org/ticket/721#comment:1>
Chicken Scheme <http://www.call-with-current-continuation.org/>
Chicken Scheme is a compiler for the Scheme programming language.