[Glass] Stream >> cr is wrong?
Mariano Martinez Peck
marianopeck at gmail.com
Mon Mar 17 14:22:09 PDT 2014
On Mon, Mar 17, 2014 at 6:03 PM, James Foster <
james.foster at gemtalksystems.com> 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
>
> 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
>
>
--
Mariano
http://marianopeck.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20140317/ca6e7f7f/attachment-0001.html>
More information about the Glass
mailing list