Re: [Pharo-dev] About cr and lf

2017-08-06 Thread Stephan Eggermont
On 06/08/17 15:25, Peter Uhnak wrote: Hi, that's why one of the proposals was to configure the stream to either use always specific line endings stream beForWindows. stream newLine. "outputs CRLF irrespective of where the image is currently running" and stream beForCurrentPlatform. stream

Re: [Pharo-dev] About cr and lf

2017-08-06 Thread Stephane Ducasse
Hi Guille I agree with you :). Stef On Sun, Aug 6, 2017 at 11:05 AM, Guillermo Polito wrote: > > > On Sun, Aug 6, 2017 at 10:54 AM, Stephane Ducasse > wrote: > >> Agreed :) >> >> But so far what do we do? >> >> >> - #cr and #lf just put

Re: [Pharo-dev] About cr and lf

2017-08-06 Thread Peter Uhnak
Hi, that's why one of the proposals was to configure the stream to either use always specific line endings stream beForWindows. stream newLine. "outputs CRLF irrespective of where the image is currently running" and stream beForCurrentPlatform. stream newLine. "returns whatever it is

Re: [Pharo-dev] About cr and lf

2017-08-06 Thread Guillermo Polito
On Sun, Aug 6, 2017 at 11:47 AM, Thierry Goubier wrote: > Hi Stef, all, > > I'd like to point out that, during the life of an image (prepared on > windows, then used on Linux, then on Mac), the meaning of a new line > changes -> should then all 'newLines' done on

Re: [Pharo-dev] About cr and lf

2017-08-06 Thread Thierry Goubier
Hi Stef, all, I'd like to point out that, during the life of an image (prepared on windows, then used on Linux, then on Mac), the meaning of a new line changes -> should then all 'newLines' done on streams while on windows be changed when the image restart on Linux? My take would be: - Set

Re: [Pharo-dev] About cr and lf

2017-08-06 Thread Guillermo Polito
On Sun, Aug 6, 2017 at 10:54 AM, Stephane Ducasse wrote: > Agreed :) > > But so far what do we do? > > > - #cr and #lf just put this character in the stream. > yes. I would even be a bit more agressive. Streams work on any collection, not only on strings (that's why I

Re: [Pharo-dev] About cr and lf

2017-08-06 Thread Stephane Ducasse
Agreed :) But so far what do we do? - #cr and #lf just put this character in the stream. - #newLine put the underlying OS line ending. Then we should revisit all the cr inside the system and use newline. Then we should think about the internal usage of cr by default in Pharo (We should change

Re: [Pharo-dev] About cr and lf

2017-08-06 Thread Sven Van Caekenberghe
> On 6 Aug 2017, at 08:59, Guillermo Polito wrote: > > Can somebody propose an implementation besides on top of this discussion? I > propose such an implementation should take the form of a stream decorator > instead of changing the base implementation. YES, a

Re: [Pharo-dev] About cr and lf

2017-08-06 Thread Guillermo Polito
Can somebody propose an implementation besides on top of this discussion? I propose such an implementation should take the form of a stream decorator instead of changing the base implementation. Guille On Sun, Aug 6, 2017 at 12:01 AM, Peter Uhnak wrote: > Hi, > > just to

Re: [Pharo-dev] About cr and lf

2017-08-05 Thread Peter Uhnak
Hi, just to (hopefully) clarify my intention, maybe pseudocode would describe my thoughts better. Stream>>beForWindows "Use consistenly Windows line endings (CRLF) in the stream" self convertLineEndings: true lineEnding := String crlf Stream>>convertLineEndings:

Re: [Pharo-dev] About cr and lf

2017-08-05 Thread Guillermo Polito
Hi all, First, we should not confuse "writing into a stream" with "writing into a text file". Not all streams are to write into a text file. This means that we cannot pretend that the basic stream implementation should always do a conversion. I think that should belong to a text writer, also

Re: [Pharo-dev] About cr and lf

2017-08-05 Thread Alistair Grant
Hi Stef, On 5 August 2017 at 18:14, Stephane Ducasse wrote: > So one step at a time: > > - #cr and #lf just put this character in the stream. > - #newLine put the underlying OS line ending. ( and sorry for the > nostalgic but nl sucks and to me this is netherlands and

Re: [Pharo-dev] About cr and lf

2017-08-05 Thread Stephane Ducasse
:) Me too. Stef On Sat, Aug 5, 2017 at 6:32 PM, Cyril Ferlicot wrote: > On Sat, Aug 5, 2017 at 6:14 PM, Stephane Ducasse > wrote: >> So one step at a time: >> >> - #cr and #lf just put this character in the stream. >> - #newLine put the

Re: [Pharo-dev] About cr and lf

2017-08-05 Thread Cyril Ferlicot
On Sat, Aug 5, 2017 at 6:14 PM, Stephane Ducasse wrote: > So one step at a time: > > - #cr and #lf just put this character in the stream. > - #newLine put the underlying OS line ending. ( and sorry for the > nostalgic but nl sucks and to me this is netherlands and not

Re: [Pharo-dev] About cr and lf

2017-08-05 Thread Stephane Ducasse
So one step at a time: - #cr and #lf just put this character in the stream. - #newLine put the underlying OS line ending. ( and sorry for the nostalgic but nl sucks and to me this is netherlands and not newline :). Then we should revisit all the cr inside the system and use newline. Then we

Re: [Pharo-dev] About cr and lf

2017-08-05 Thread K K Subbu
On Friday 04 August 2017 07:11 PM, Damien Pollet wrote: Stream >> newLineFor: platform self nextPutAll: platform lineEnding EOL encoding is a property of a text file and not a platform. While files created on a certain proprietary platforms ;-) may use an encoding that does not make it

Re: [Pharo-dev] About cr and lf

2017-08-05 Thread Alexandre Bergel
+1 -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. > On Aug 4, 2017, at 8:19 AM, Esteban Lorenzano wrote: > > sometimes you actually want to write a cr (or a lf). So it needs to

Re: [Pharo-dev] About cr and lf

2017-08-05 Thread Alistair Grant
Hi Esteban, On Sat, Aug 05, 2017 at 11:30:58AM +0200, Esteban Lorenzano wrote: > > > On 5 Aug 2017, at 11:17, Peter Uhnak wrote: > > > >> I think there is a consensus we need to keep #cr and #lf as intended > > > > Is there? > > > > My argument was that there's no

Re: [Pharo-dev] About cr and lf

2017-08-05 Thread Esteban Lorenzano
> On 5 Aug 2017, at 11:17, Peter Uhnak wrote: > >> I think there is a consensus we need to keep #cr and #lf as intended > > Is there? > > My argument was that there's no (obvious) reason to combine different line > endings in the same document. Therefore if you were to use

Re: [Pharo-dev] About cr and lf

2017-08-05 Thread Peter Uhnak
> I think there is a consensus we need to keep #cr and #lf as intended Is there? My argument was that there's no (obvious) reason to combine different line endings in the same document. Therefore if you were to use #cr, #lf, #crlf, you would actually mean that you just want to enter newline.

Re: [Pharo-dev] About cr and lf

2017-08-05 Thread Esteban Lorenzano
> On 5 Aug 2017, at 11:14, Alistair Grant wrote: > > On Sat, Aug 05, 2017 at 11:09:51AM +0200, Esteban Lorenzano wrote: >> >>> On 5 Aug 2017, at 11:06, Alistair Grant wrote: >>> >>> On Sat, Aug 05, 2017 at 10:49:02AM +0200, Esteban Lorenzano

Re: [Pharo-dev] About cr and lf

2017-08-05 Thread Alistair Grant
On Sat, Aug 05, 2017 at 11:09:51AM +0200, Esteban Lorenzano wrote: > > > On 5 Aug 2017, at 11:06, Alistair Grant wrote: > > > > On Sat, Aug 05, 2017 at 10:49:02AM +0200, Esteban Lorenzano wrote: > >> I think there is a consensus we need to keep #cr and #lf as intended, >

Re: [Pharo-dev] About cr and lf

2017-08-05 Thread Esteban Lorenzano
> On 5 Aug 2017, at 11:06, Alistair Grant wrote: > > On Sat, Aug 05, 2017 at 10:49:02AM +0200, Esteban Lorenzano wrote: >> I think there is a consensus we need to keep #cr and #lf as intended, >> yet to add some kind of #newLine (which btw is different to EOL :P) >>

Re: [Pharo-dev] About cr and lf

2017-08-05 Thread Alistair Grant
On Sat, Aug 05, 2017 at 10:49:02AM +0200, Esteban Lorenzano wrote: > I think there is a consensus we need to keep #cr and #lf as intended, > yet to add some kind of #newLine (which btw is different to EOL :P) > vocabulary, isn???t? > > In this, I favour Peter approach for define line ending

Re: [Pharo-dev] About cr and lf

2017-08-05 Thread Esteban Lorenzano
I think there is a consensus we need to keep #cr and #lf as intended, yet to add some kind of #newLine (which btw is different to EOL :P) vocabulary, isn’t? In this, I favour Peter approach for define line ending convention (the way #newLine will work)… and of course by default it should use

Re: [Pharo-dev] About cr and lf

2017-08-04 Thread Tudor Girba
+1. We need a basic representation of those characters. Logical ones should be derived from the simple ones. Doru > On Aug 4, 2017, at 3:44 PM, Esteban Lorenzano wrote: > > >> On 4 Aug 2017, at 15:41, Damien Pollet wrote: >> >> I agree with

Re: [Pharo-dev] About cr and lf

2017-08-04 Thread Damien Pollet
On 4 August 2017 at 18:52, Peter Uhnak wrote: > On Fri, Aug 04, 2017 at 03:41:05PM +0200, Damien Pollet wrote: > > > Stream >> newLineForWindows "convenience for the most common platforms > > Stream >> newLineForUnix > > Stream >> newLineForHistoricReasons > > Practically

Re: [Pharo-dev] About cr and lf

2017-08-04 Thread Gabriel Cotelli
I vote for: #cr and #lf just put this character in the stream. #newLine put the underlying OS line ending. This is consisten also with String>>expandMacrosWithArguments: -> cr -> lf -> OSPlatform current lineEnding On Fri, Aug 4, 2017 at 7:03 AM, Stephane Ducasse

Re: [Pharo-dev] About cr and lf

2017-08-04 Thread Jan Vrany
On Fri, 2017-08-04 at 14:06 +0200, Stephane Ducasse wrote: > Well. This is not implemented like that in Pharo. > > cr is bad because it does not mean that it is independent of the > platform. > So cr can be redefined as newLine and keep but not used inside the > system. Yes, that's exactly what

Re: [Pharo-dev] About cr and lf

2017-08-04 Thread Peter Uhnak
On Fri, Aug 04, 2017 at 03:41:05PM +0200, Damien Pollet wrote: > Stream >> newLineForWindows "convenience for the most common platforms > Stream >> newLineForUnix > Stream >> newLineForHistoricReasons Practically speaking this looks insanely wordy. In 102% (est.) you want to use the same

Re: [Pharo-dev] About cr and lf

2017-08-04 Thread Stephane Ducasse
Yes :) On Fri, Aug 4, 2017 at 2:25 PM, teso...@gmail.com wrote: > To me it is clear that cr and lf should be in streams. But they should put > the 'cr' or 'lf' character only. And of course the platform independent > newline should be also. > > The first (cr, lf) should be

Re: [Pharo-dev] About cr and lf

2017-08-04 Thread Esteban Lorenzano
> On 4 Aug 2017, at 15:41, Damien Pollet wrote: > > I agree with Pablo, #cr and #lf should not be clever and just be names for > the carriage return and linefeed characters/codepoints. +1 > > Making #newLine's behavior dependent on the current platform disturbs me,

Re: [Pharo-dev] About cr and lf

2017-08-04 Thread Damien Pollet
I agree with Pablo, #cr and #lf should not be clever and just be names for the carriage return and linefeed characters/codepoints. Making #newLine's behavior dependent on the current platform disturbs me, though. I'd rather have: Stream >> newLineFor: platform self nextPutAll: platform

Re: [Pharo-dev] About cr and lf

2017-08-04 Thread Javier Pimás
or eol On Fri, Aug 4, 2017 at 9:19 AM, Esteban Lorenzano wrote: > > > On 4 Aug 2017, at 14:06, Stephane Ducasse > wrote: > > > > Well. This is not implemented like that in Pharo. > > > > cr is bad because it does not mean that it is independent of

Re: [Pharo-dev] About cr and lf

2017-08-04 Thread teso...@gmail.com
To me it is clear that cr and lf should be in streams. But they should put the 'cr' or 'lf' character only. And of course the platform independent newline should be also. The first (cr, lf) should be used by the code wanting to have absolute control of what is in the stream. The later (newline)

Re: [Pharo-dev] About cr and lf

2017-08-04 Thread Esteban Lorenzano
> On 4 Aug 2017, at 14:06, Stephane Ducasse wrote: > > Well. This is not implemented like that in Pharo. > > cr is bad because it does not mean that it is independent of the platform. > So cr can be redefined as newLine and keep but not used inside the system.

Re: [Pharo-dev] About cr and lf

2017-08-04 Thread Stephane Ducasse
Well. This is not implemented like that in Pharo. cr is bad because it does not mean that it is independent of the platform. So cr can be redefined as newLine and keep but not used inside the system. Stef On Fri, Aug 4, 2017 at 12:50 PM, Jan Vrany wrote: > On Fri,

Re: [Pharo-dev] About cr and lf

2017-08-04 Thread Guillermo Polito
But the question is: what does cr do? - Does it write a platform independent newLine? - Or does it write a (platform dependent) cr ascii character? http://www.theasciicode.com.ar/ascii-control-characters/carriage-return-ascii-code-13.html On Fri, Aug 4, 2017 at 12:50 PM, Jan Vrany

Re: [Pharo-dev] About cr and lf

2017-08-04 Thread Jan Vrany
On Fri, 2017-08-04 at 12:03 +0200, Stephane Ducasse wrote: > Hi guys > > While writing pillar code, I ended up using "stream cr" and it > worries > me to still expand usage > of a pattern I would like to remove. > > Let us imagine that we would like to prepare the migration from cr. > I was

[Pharo-dev] About cr and lf

2017-08-04 Thread Stephane Ducasse
Hi guys While writing pillar code, I ended up using "stream cr" and it worries me to still expand usage of a pattern I would like to remove. Let us imagine that we would like to prepare the migration from cr. I was thinking that we could replace cr invocation by newLine so that after newLine