Coder Social home page Coder Social logo

Comments (15)

eMaringolo avatar eMaringolo commented on May 29, 2024 1

I thing that this is an issue of STON or STON in VA in particular. STONWriter provides a way to change the newLine (and I used that to fix this issue).

In my opinion using the host OS EOL is the sensible default.

from tonel-vast.

dalehenrich avatar dalehenrich commented on May 29, 2024

Perhaps this is a duplicate of issue #3?

from tonel-vast.

dalehenrich avatar dalehenrich commented on May 29, 2024

It's not just vim where this is a problem

from tonel-vast.

eMaringolo avatar eMaringolo commented on May 29, 2024

@dalehenrich by the Tonel Writer uses system's default EOL defined by a Kernel package shared pool (CldtConstants::LineDelimiter).

Here there are a few options, the one taken in #3, where you can customize the EOL for the writer, or use git EOL conversion by means of a .gitattributes rule or o a global git setting.

from tonel-vast.

martinmcclure avatar martinmcclure commented on May 29, 2024

The forthcoming Tonel draft spec specifies that all files should use the native line ending of the local platform (CRLF for Windows, LF for Unix).

from tonel-vast.

dalehenrich avatar dalehenrich commented on May 29, 2024

If either CRLF or LF are allowed, then it seems that projects that use Tonel should setup a .gitattributes file with the appropriate settings to ensure that the CRLF and LF are automatically converted per platform ... is that something that could/should be included in the Tonel spec?

@martinmcclure, it is then correct to say that CR is not a legal line delimiter for Tonel files? Regardless of the setting of (CldtConstants::LineDelimiter) Tonel files should use either CRLF or LF ...

from tonel-vast.

martinmcclure avatar martinmcclure commented on May 29, 2024

.gitattributes is beyond the scope of the Tonel spec, since the spec does not require the use of Git. But when using Git, I would recommend the appropriate .gitattributes file to make sure that Git does end-of-line normalization for all Tonel files.

In Tonel, the only line delimiter that is legal for a Tonel Writer to write is that of the native OS platform on which the file appears. I don't know of any modern OSes that use only CR as a line delimiter. If there were any, CR would be legal there, and only there. Tonel Readers must accept either CRLF or LF.

from tonel-vast.

dalehenrich avatar dalehenrich commented on May 29, 2024

Regarding .gitattributes ... makes sense ... my only complaint here is readability and using the native platform's line ending would satisfy my readability complaint ... vim would see files with LF and that's the ticket ... Since Rowan uses some STON files outside the context of Tonel files, I would want the same line ending rules to apply to Rowan STON files ...

from tonel-vast.

eMaringolo avatar eMaringolo commented on May 29, 2024

@martinmcclure @dalehenrich : The TonelWriter is configurable as per the commit for #3, and the user has the option to normalize the EOL by means of .gitattributes.
And as you say, the EOL is commonly the one of the host OS, which in Windows is CRLF. So Rowan should expect some STON files to be written using that line delimiter too.

from tonel-vast.

dalehenrich avatar dalehenrich commented on May 29, 2024

@eMaringolo ...

the source of my complaint about the use of CR as the EOL character used in the STON that is the VALUE of the vaSubApplications key in the package.st file ... the EOL in the rest of the package.st file is using LF ...

the STON string used in the vaSubApplications should also conform to the host OS EOL ... and in this particular case it does not ...

On closer inspection it looks like the value of vaSubApplications is a string that is using CR as the line delimiter and I'm asking that when you generate this string (presumably independent of the TonelWriter implementation) that you take care to honor the TonelWriter line delemiter settings ...

from tonel-vast.

eMaringolo avatar eMaringolo commented on May 29, 2024

@dalehenrich I fixed it now, the STONWriter uses CR by default, maybe it is a bug in the STONWriter of VA? cc: @marianopeck

from tonel-vast.

dalehenrich avatar dalehenrich commented on May 29, 2024

@eMaringolo shouldn't that be that the STONWriter uses LF by default?

I think that the Pharo implementation of STONWriter probably did use (and may still use) CR when pretty printing, but in GemStone I've change the STONWriter pretty printer to use LF instead, otherwise STON files are unreadable (by humans) on Linux ... and of course the point of pretty printing a STON file is to make it human readable:)

from tonel-vast.

marianopeck avatar marianopeck commented on May 29, 2024

Hi @dalehenrich @eMaringolo
Yes, in VAST I respected the same semantics as in Pharo, that is, use CR. I can still see this on a Pharo 8 in STONWriter >> initialize.
But..I really don't know why it makes sense to be CR. To me it looks much better either CRLF (Windows) or LF, but why CR???

I am not sure either that LF should be the default in VAST as most customers are on Windows. If we use LF then it will be unreadable by humans on Windows. So CRLF would be better here. Obviously, both scenarios could be fixed by using a proper text editor..

One final option is what we did with Tonel, which is to use, by default, the line delimiter of the current platform. So..if you are on Windows, default is CRLF and if you are on Linux it is LF.

Thoughts?

from tonel-vast.

dalehenrich avatar dalehenrich commented on May 29, 2024

I think that the platform EOL is the right answer, for all the same reasons that Tonel uses the platform EOL ... Pharo uses CR all over the place and all of the Pharo text editors work equally fine with CR/CRLF/LF ... but that is only true for Pharo as the rest of the world gags on CR:) ... CR was the default EOL for the original Squeak and unlike the _ for assignment has not been as quickly changed ...

from tonel-vast.

marianopeck avatar marianopeck commented on May 29, 2024

OK guys, thanks for the feedback. I opened case "65559: Change STONWriter default lineDelimiter from CR to local platform default". Will be included in next release of VAST.

from tonel-vast.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.