Hi guys,
I think I found a bug. Just watching the code, #cr answering LF makes me wonder... Stream >> cr "Adds a newline to the output stream."
self nextPut: Character lf. This piece of code String new writeStream nextPutAll: 'mariano';
cr;lf; nextPutAll: 'bug?'; contents answers 'mariano bug?' While this one: String new writeStream
nextPutAll: 'mariano'; nextPut: Character cr; nextPut: Character lf;
nextPutAll: 'bug?'; contents Answers: 'mariano
bug?' So....is this a bug? or is it on purpose? I ask because I have code sending #crlf and in Pharo it is correct but in GemStone I get empty rows below each row ;) Thanks, Mariano http://marianopeck.wordpress.com _______________________________________________ Glass mailing list [hidden email] http://lists.gemtalksystems.com/mailman/listinfo/glass |
ANSI 5.9.4.1 specifies that <puttableStream> #’cr’ "Writes an end-of-line sequence to the receiver.” On Linux, the end-of-line sequence is LF, so this is by design (though rather confusing).
On Mar 17, 2014, at 1:57 PM, Mariano Martinez Peck <[hidden email]> wrote: > Hi guys, > > I think I found a bug. Just watching the code, #cr answering LF makes me wonder... > > Stream >> cr > > "Adds a newline to the output stream." > > self nextPut: Character lf. > > This piece of code > > String new writeStream > nextPutAll: 'mariano'; > cr;lf; > nextPutAll: 'bug?'; > contents > > answers > > 'mariano > > bug?' > > > While this one: > > String new writeStream > nextPutAll: 'mariano'; > nextPut: Character cr; > nextPut: Character lf; > nextPutAll: 'bug?'; > contents > > Answers: > > 'mariano > bug?' > > So....is this a bug? or is it on purpose? I ask because I have code sending #crlf and in Pharo it is correct but in GemStone I get empty rows below each row ;) > > Thanks, > > > > -- > Mariano > http://marianopeck.wordpress.com > _______________________________________________ > Glass mailing list > [hidden email] > http://lists.gemtalksystems.com/mailman/listinfo/glass _______________________________________________ Glass mailing list [hidden email] http://lists.gemtalksystems.com/mailman/listinfo/glass |
On Mon, Mar 17, 2014 at 6:03 PM, James Foster <[hidden email]> wrote: ANSI 5.9.4.1 specifies that <puttableStream> #’cr’ "Writes an end-of-line sequence to the receiver.” On Linux, the end-of-line sequence is LF, so this is by design (though rather confusing). mmmm ok, that explains why: WriteStream >> crlf self nextPut: Character cr;
nextPut: Character lf; yourself. instead of "self cr; lf" ok...so I should not send cr;lf but instead either #crlf or send the nextPut: for each one... or... use
Mariano http://marianopeck.wordpress.com _______________________________________________ Glass mailing list [hidden email] http://lists.gemtalksystems.com/mailman/listinfo/glass |
Free forum by Nabble | Edit this page |