[Q][RFI] Where ends a line of ASCII text ?
Yoshiki Ohshima
yoshiki at squeakland.org
Thu Mar 17 07:44:15 UTC 2005
Edgar,
> We have
> nextLine
> "Answer next line (may be empty), or nil if at end"
>
> self atEnd ifTrue: [^nil].
> ^self upTo: Character cr
>
> In PositionableStream, but not all OS agree what a line ends in cr
The subclasses of PositionableStream, except some exceptions, only
handles strings in Squeak. All of these line ending should be
canonical Squeak line-ending.
> nextLineLf
> | nextLine |
> nextLine := self upToAll: String lf.
> ^nextLine
>
> In SocketStream
>
> The consensus is not change or add methods to base classes as
> PositionableStream , but also seems silly add nextLineLf or nextLineCrLf
> each time we need
SocketStream is an exception. It talks with outside world. I don't
think it is too silly to add #nextLineLf and #nextLineCrLf to
SocketStream, as most of the network protocol specify the
line-endings.
> So what to do ? I proposing have #cleverNextLine.
I think we don't need this too badly.
-- Yoshiki
More information about the Squeak-dev
mailing list
|