[Glass] Stream >> cr is wrong?
James Foster
james.foster at gemtalksystems.com
Mon Mar 17 14:03:25 PDT 2014
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 <marianopeck at gmail.com> 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
> Glass at lists.gemtalksystems.com
> http://lists.gemtalksystems.com/mailman/listinfo/glass
More information about the Glass
mailing list