[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 9fd4e3: Use LF instead of CR as image/*.st line ending

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Fri Apr 28 07:48:08 UTC 2017


2017-04-28 7:47 GMT+02:00 Eliot Miranda <eliot.miranda at gmail.com>:

>
> Ben,
>
> On Apr 27, 2017, at 7:06 PM, Ben Coman <btc at openinworld.com> wrote:
>
>
>
> On Fri, Apr 28, 2017 at 6:16 AM, Eliot Miranda <eliot.miranda at gmail.com>
> wrote:
>
>>
>>
>>
>> On Thu, Apr 27, 2017 at 2:38 PM, Nicolas Cellier <
>> nicolas.cellier.aka.nice at gmail.com> wrote:
>>
>>>
>>> Hi Eliot,
>>> it's not about my favourite editor, it's about the universally available
>>> one:
>>>
>>> https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/57c
>>> 9ef837f7b0914351c4836734d1df3c880c288
>>>
>>> The LF are displayed correctly in Squeak/Pharo and we can use nextLine
>>> in replacement of upTo: Character cr, so I fail to see the problem of LF.
>>> Could you explain?
>>>
>>
>> It's ok.  I give up.  This is another example of the tail wagging the
>> dog, which gets on my nerves.  But getting them to fix their interface is
>> way more difficult than us accommodating their limitations so go ahead.
>>
>
> Its not github!  When looking into Sophie's issue, opening those ST
> scripts were unreadable
> when opened in `vi` .  It was a pain that I had to break context to hunt
> for a GUI text app to read them
>
>
> It's a three liner to wrap vi in a script that converts from CR to LF,
> invokes vi and then concerts back.  Is it really that problematic?
>
>
>
> CR-only line endings are sooooooo last century, for machines like:
> Commodore 8-bit machines, Acorn BBC, ZX Spectrum, TRS-80, Apple II family,
> Oberon, the classic Mac OS up to version 9, MIT Lisp Machine and OS-9 [1].
> These dogs died a long time ago ;)
>
> Is there something particularly Smalltalk related I'm not aware of that
> makes CR-only line endings preferable?
>
> [1] https://en.wikipedia.org/wiki/Newline
>
> cheers -ben
>
>
Ben,
There's no need to have three ways to do the same thing, line ending. So
Smalltalk has chosen one and stick to it. it was CR.
Thus you will see a message #cr used everywhere in the code base (either
sent to Character or to a WriteStream to write an end of line).
Also, carriage return is used thru a CR variable in TextConstants pool
dictionary.

The wisdom was that connections to/from outside world (external streams
like files/sockets...) should do the conversion in/out the Smalltalk space.
But this has been inequally applied, especially in Squeak/Pharo where the
zoo of Stream is not so well engineered (it's a mess!).

Since the boundary was messy, I've taken the responsibility to introduce
the complexity inside the code base by:
- changing display of LF and adding hacks to display a single end of line
in case of CR-LF pair
- introduce nextLine et a few other methods to deal with the zoo of line
endings
I'm still not completely sure that it was a good idea... Maybe

If we want to change our conventions to be more fashioned, we must get rid
of cr message in the code base and replace it with something like eol (end
of line).
Cuis has changed the CR to LF inside the image.

Nicolas

>
>
>>
>>>
>>> 2017-04-27 23:28 GMT+02:00 Eliot Miranda <eliot.miranda at gmail.com>:
>>>
>>>>
>>>> Please revert this.  It is easy to write a wrapper around your
>>>> favourite editor to map returns.  These scripts should be in CR endings.
>>>>
>>>> _,,,^..^,,,_ (phone)
>>>>
>>>> > On Apr 27, 2017, at 12:32 PM, GitHub <noreply at github.com> wrote:
>>>> >
>>>> >  Branch: refs/heads/Cog
>>>> >  Home:   https://github.com/OpenSmalltalk/opensmalltalk-vm
>>>> >  Commit: 9fd4e371ae0895078fce13ea35c491daf0e448e0
>>>> >      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/9fd
>>>> 4e371ae0895078fce13ea35c491daf0e448e0
>>>> >  Author: Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>
>>>> >  Date:   2017-04-27 (Thu, 27 Apr 2017)
>>>> >
>>>> >  Changed paths:
>>>> >    M .gitattributes
>>>> >    M image/BuildSpurReader64Image.st
>>>> >    M image/BuildSpurTrunk64Image.st
>>>> >    M image/BuildSqueakSpurTrunkVMMakerImage.st
>>>> >    M image/CompiledMethod-usesAlternateBytecodeSet.st
>>>> >    M image/FT2Constants.st
>>>> >    M image/LoadReader.st
>>>> >    M image/LoadSistaSupport.st
>>>> >    M image/Object-performwithwithwithwithwith.st
>>>> >    M image/RunATestClass.st
>>>> >    M image/StartReader.st
>>>> >    M image/UpdateSqueakTrunkImage.st
>>>> >
>>>> >  Log Message:
>>>> >  -----------
>>>> >  Use LF instead of CR as image/*.st line ending
>>>> >
>>>> > This is to be able to review/blame/ etc... from GitHub web interface
>>>> (1 liner with 500+ columns is not tool friendly)
>>>> >
>>>> >
>>>> >  Commit: c4881946c2bb8b7da7b191489dbf7ae180b05f51
>>>> >      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/c48
>>>> 81946c2bb8b7da7b191489dbf7ae180b05f51
>>>> >  Author: Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>
>>>> >  Date:   2017-04-27 (Thu, 27 Apr 2017)
>>>> >
>>>> >  Changed paths:
>>>> >    M platforms/Cross/plugins/CroquetPlugin/CroquetPlugin.h
>>>> >    M platforms/Cross/plugins/CroquetPlugin/TriBoxStub.c
>>>> >
>>>> >  Log Message:
>>>> >  -----------
>>>> >  Merge branch 'Cog' of https://github.com/OpenSmallta
>>>> lk/opensmalltalk-vm into Cog
>>>> >
>>>> >
>>>> > Compare: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/bf
>>>> e983b7a720...c4881946c2bb
>>>>
>>>
>>>
>>>
>>
>>
>> --
>> _,,,^..^,,,_
>> best, Eliot
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20170428/deacd8a0/attachment.html>


More information about the Vm-dev mailing list