|
View:
New views
7 Messages
—
Rating Filter:
Alert me
|
|
|
|
|
|
Re: On particles, Sources, fieldsFYI I totally agree that it should just deal with whatever line ending
it finds, and that's the way I originally wrote it, and that's what will be the default if it's up to me. However most of the annoying work I'm doing here revolves around the decision to leave the platform default encoding in place when it's left unspecified. Line ending defaults aren't the same as charset defaults, but it is all tied together if one seeks anything resembling consistency. -- Paul Phillips | One way is to make it so simple that there are Stickler | obviously no deficiencies. And the other way is to make Empiricist | it so complicated that there are no obvious deficiencies. i pull his palp! | -- Hoare |
|
|
Re: On particles, Sources, fieldsEven at system level, I'd want to just have a bunch of lines that I can iterate over - without caring for the exact nature of the delimiters. Including the line terminators in this scenario would be equivalent to putting "," into every other element of a string array.
I'm struggling to imagine a scenario where I could open a file that contained mixed line endings, or where I'd need to handle \r, \n, \r\n, or \n\r differently within a single file, not unless you truly intend for \r to be a carriage return without a line feed so that you can overwrite text to give underlined or bold characters. I believe this technique died out with punch cards, although I fully appreciate the need to process and import old data sets...
Agreed, once a file is opened then any subsequent appended lines should match whatever encoding is already in place. This is an important requirement and should be clearly specified. It should also be transparent to the user of the library.
Anything deeper than this I would argue that you aren't actually working with lines at all, and should really be looking at a character-level API.
On Wed, Aug 19, 2009 at 4:57 PM, Christos KK Loverdos <loverdos@...> wrote: [moving to scala-debate, was Re: [scala-user] feedback on scala.io.Source] |
|
|
Re: On particles, Sources, fields> I'm struggling to imagine a scenario where I could open a file that
> contained mixed line endings Most of our code and related activity uses whatever Linux uses for line endings. One pom.xml contains Windows line endings. I edited this with vim in Linux, adding in Linux-style line endings. This file now has mixed line endings. I am quite glad that this does not perturb anything I use to open files. -- Ricky Clarkson Java Programmer, AD Holdings +44 1565 770804 Skype: ricky_clarkson Google Talk: ricky.clarkson@... |
|
|
Re: On particles, Sources, fieldsOn Wed, Aug 19, 2009 at 6:36 PM, Ricky Clarkson <ricky.clarkson@...> wrote:
Wow, now that's fast feedback with an example. So close to home as well...
|
|
|
Re: On particles, Sources, fieldsOn Wednesday August 19 2009, Ricky Clarkson wrote:
> > I'm struggling to imagine a scenario where I could open a file that > > contained mixed line endings > > Most of our code and related activity uses whatever Linux uses for > line endings. One pom.xml contains Windows line endings. I edited > this with vim in Linux, adding in Linux-style line endings. This > file now has mixed line endings. I am quite glad that this does not > perturb anything I use to open files. I guess Vim has lots of modes, 'cause in my experience (on Linux) it adapts to the line-endings of the file being edited and preserves it when you save it unless you explicitly do something like: :set ff=unix or :set ff=dos And if issuing one of these commands actually changes the files's bytes, you'll have to save it (or explicitly discard the changes) to quit, just as if you'd used a Vim editing command. Randall Schulz |
|
|
Re: On particles, Sources, fieldsOn Wed, Aug 19, 2009 at 6:36 PM, Ricky Clarkson <ricky.clarkson@...> wrote:
I just thought... Doesn't SVN reformat line endings as appropriate for the local environment? |
| Free embeddable forum powered by Nabble | Forum Help |