Re: [Factor-talk] EOL

2017-02-15 Thread Björn Lindqvist
IMHO, it is better to have newline always be \n. On Windows, the
situation is messy because when you are dealing with Unix files you
want \n but when dealing with DOS files you want \r\n. I think what we
are doing now which is accepting both \n and \r\n when reading and
only emitting \n when writing is fine. Most Windows programs worth
their salt works with either newline sequence.

2017-02-07 18:55 GMT+01:00 John Benediktsson :
> if you want to make a patch and see how it looks, sure we can talk about it!
>
> On Tue, Feb 7, 2017 at 9:53 AM, Alexander Ilin  wrote:
>>
>> I'm all for using \n, but being on Windows, I sometimes need to explicitly
>> produce native text files. In my today's use case I have coded some VS 2005
>> solution file transformations in Factor, after which Git showed the entire
>> file as changed due to EOL conversion that implicitly took place in
>> `change-file-lines`. Explicit setting would satisfy me, although, now that
>> I'm thinking about it, the `change-file-lines` could have preserved the line
>> endings it found in the file, because it has read it in the first place. But
>> that's a pretty high-level feature to ask, which can't happen until a
>> lower-level mechanism is in place.
>>
>> 07.02.2017, 20:29, "John Benediktsson" :
>>
>> maybe, there are some historical differences that make newlines funny
>> business
>>
>> https://blog.codinghorror.com/the-great-newline-schism/
>>
>> I'd love to just use '\n' everywhere.
>>
>>
>> On Tue, Feb 7, 2017 at 9:24 AM, Alexander Ilin  wrote:
>>
>> Helllo, John!
>>
>> Suggestion taken, thank you!
>>
>> Why isn't there a symbol like `eol`, so it would be possible to do
>> something like
>>
>> ```
>> [ "\r\n" eol [ ... ] with-variable ] with-file-writer
>> ```
>>
>> Or even like
>>
>> ```
>> [ crlf [ ... ] with-eol ] with-file-writer
>> ```
>>
>>   Interested in a PR?
>>
>> 07.02.2017, 16:40, "John Benediktsson" :
>> > You could add the line endings yourself:
>> >
>> > "\r\n" join set-file-contents
>> >
>> > or if you are memory constrained, write them:
>> >
>> > [ [ write "\r\n" write ] each ] with-file-writer
>> >
>> >>  On Feb 7, 2017, at 4:15 AM, Alexander Ilin  wrote:
>> >>
>> >>  Hello!
>> >>
>> >>   Is there a way to use `change-file-lines`, but override EOL to be
>> >> CR+LF in the output?
>> >>   If not, what's the alternative solution?
>> >>
>> >>  ---=---
>> >>  Александр
>> >>
>> >>
>> >> --
>> >>  Check out the vibrant tech community on one of the world's most
>> >>  engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> >>  ___
>> >>  Factor-talk mailing list
>> >>  Factor-talk@lists.sourceforge.net
>> >>  https://lists.sourceforge.net/lists/listinfo/factor-talk
>> >
>> >
>> > --
>> > Check out the vibrant tech community on one of the world's most
>> > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> > ___
>> > Factor-talk mailing list
>> > Factor-talk@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/factor-talk
>>
>> ---=---
>>  Александр
>>
>>
>> --
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> ___
>> Factor-talk mailing list
>> Factor-talk@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/factor-talk
>>
>> ,
>>
>>
>> --
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>>
>> ,
>>
>> ___
>> Factor-talk mailing list
>> Factor-talk@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/factor-talk
>>
>>
>>
>> ---=---
>> Александр
>>
>>
>>
>> --
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> ___
>> Factor-talk mailing list
>> Factor-talk@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/factor-talk
>>
>
>
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> 

Re: [Factor-talk] EOL

2017-02-07 Thread John Benediktsson
if you want to make a patch and see how it looks, sure we can talk about it!

On Tue, Feb 7, 2017 at 9:53 AM, Alexander Ilin  wrote:

> I'm all for using \n, but being on Windows, I sometimes need to explicitly
> produce native text files. In my today's use case I have coded some VS 2005
> solution file transformations in Factor, after which Git showed the entire
> file as changed due to EOL conversion that implicitly took place in
> `change-file-lines`. Explicit setting would satisfy me, although, now that
> I'm thinking about it, the `change-file-lines` could have preserved the
> line endings it found in the file, because it has read it in the first
> place. But that's a pretty high-level feature to ask, which can't happen
> until a lower-level mechanism is in place.
>
> 07.02.2017, 20:29, "John Benediktsson" :
>
> maybe, there are some historical differences that make newlines funny
> business
>
> https://blog.codinghorror.com/the-great-newline-schism/
>
> I'd love to just use '\n' everywhere.
>
>
> On Tue, Feb 7, 2017 at 9:24 AM, Alexander Ilin  wrote:
>
> Helllo, John!
>
> Suggestion taken, thank you!
>
> Why isn't there a symbol like `eol`, so it would be possible to do
> something like
>
> ```
> [ "\r\n" eol [ ... ] with-variable ] with-file-writer
> ```
>
> Or even like
>
> ```
> [ crlf [ ... ] with-eol ] with-file-writer
> ```
>
>   Interested in a PR?
>
> 07.02.2017, 16:40, "John Benediktsson" :
> > You could add the line endings yourself:
> >
> > "\r\n" join set-file-contents
> >
> > or if you are memory constrained, write them:
> >
> > [ [ write "\r\n" write ] each ] with-file-writer
> >
> >>  On Feb 7, 2017, at 4:15 AM, Alexander Ilin  wrote:
> >>
> >>  Hello!
> >>
> >>   Is there a way to use `change-file-lines`, but override EOL to be
> CR+LF in the output?
> >>   If not, what's the alternative solution?
> >>
> >>  ---=---
> >>  Александр
> >>
> >>  ---
> ---
> >>  Check out the vibrant tech community on one of the world's most
> >>  engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> >>  ___
> >>  Factor-talk mailing list
> >>  Factor-talk@lists.sourceforge.net
> >>  https://lists.sourceforge.net/lists/listinfo/factor-talk
> >
> > 
> --
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> > ___
> > Factor-talk mailing list
> > Factor-talk@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/factor-talk
>
> ---=---
>  Александр
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
> ,
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ,
>
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>
>
> ---=---
> Александр
>
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] EOL

2017-02-07 Thread Alexander Ilin
I'm all for using \n, but being on Windows, I sometimes need to explicitly produce native text files. In my today's use case I have coded some VS 2005 solution file transformations in Factor, after which Git showed the entire file as changed due to EOL conversion that implicitly took place in `change-file-lines`. Explicit setting would satisfy me, although, now that I'm thinking about it, the `change-file-lines` could have preserved the line endings it found in the file, because it has read it in the first place. But that's a pretty high-level feature to ask, which can't happen until a lower-level mechanism is in place. 07.02.2017, 20:29, "John Benediktsson" :maybe, there are some historical differences that make newlines funny business https://blog.codinghorror.com/the-great-newline-schism/ I'd love to just use '\n' everywhere.  On Tue, Feb 7, 2017 at 9:24 AM, Alexander Ilin  wrote:Helllo, John!Suggestion taken, thank you!Why isn't there a symbol like `eol`, so it would be possible to do something like```[ "\r\n" eol [ ... ] with-variable ] with-file-writer```Or even like```[ crlf [ ... ] with-eol ] with-file-writer```  Interested in a PR?07.02.2017, 16:40, "John Benediktsson" :> You could add the line endings yourself:>> "\r\n" join set-file-contents>> or if you are memory constrained, write them:>> [ [ write "\r\n" write ] each ] with-file-writer>>>  On Feb 7, 2017, at 4:15 AM, Alexander Ilin  wrote:  Hello!   Is there a way to use `change-file-lines`, but override EOL to be CR+LF in the output?>>   If not, what's the alternative solution?  ---=--->>  Александр  -->>  Check out the vibrant tech community on one of the world's most>>  engaging tech sites, SlashDot.org! http://sdm.link/slashdot>>  ___>>  Factor-talk mailing list>>  Factor-talk@lists.sourceforge.net>>  https://lists.sourceforge.net/lists/listinfo/factor-talk>> --> Check out the vibrant tech community on one of the world's most> engaging tech sites, SlashDot.org! http://sdm.link/slashdot> ___> Factor-talk mailing list> Factor-talk@lists.sourceforge.net> https://lists.sourceforge.net/lists/listinfo/factor-talk---=--- Александр--Check out the vibrant tech community on one of the world's mostengaging tech sites, SlashDot.org! http://sdm.link/slashdot___Factor-talk mailing listFactor-talk@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/factor-talk,--Check out the vibrant tech community on one of the world's mostengaging tech sites, SlashDot.org! http://sdm.link/slashdot,___Factor-talk mailing listFactor-talk@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/factor-talk  ---=---Александр --
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] EOL

2017-02-07 Thread Alexander Ilin
Helllo, John!

Suggestion taken, thank you!

Why isn't there a symbol like `eol`, so it would be possible to do something 
like

```
[ "\r\n" eol [ ... ] with-variable ] with-file-writer
```

Or even like

```
[ crlf [ ... ] with-eol ] with-file-writer
```

  Interested in a PR?

07.02.2017, 16:40, "John Benediktsson" :
> You could add the line endings yourself:
>
> "\r\n" join set-file-contents
>
> or if you are memory constrained, write them:
>
> [ [ write "\r\n" write ] each ] with-file-writer
>
>>  On Feb 7, 2017, at 4:15 AM, Alexander Ilin  wrote:
>>
>>  Hello!
>>
>>   Is there a way to use `change-file-lines`, but override EOL to be CR+LF in 
>> the output?
>>   If not, what's the alternative solution?
>>
>>  ---=---
>>  Александр
>>
>>  
>> --
>>  Check out the vibrant tech community on one of the world's most
>>  engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>>  ___
>>  Factor-talk mailing list
>>  Factor-talk@lists.sourceforge.net
>>  https://lists.sourceforge.net/lists/listinfo/factor-talk
>
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk

---=--- 
 Александр

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] EOL

2017-02-07 Thread John Benediktsson
You could add the line endings yourself:

"\r\n" join set-file-contents

or if you are memory constrained, write them:

[ [ write "\r\n" write ] each ] with-file-writer





> On Feb 7, 2017, at 4:15 AM, Alexander Ilin  wrote:
> 
> Hello!
> 
>  Is there a way to use `change-file-lines`, but override EOL to be CR+LF in 
> the output?
>  If not, what's the alternative solution?
> 
> ---=--- 
> Александр
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] EOL

2017-02-07 Thread Alexander Ilin
Hello!

  Is there a way to use `change-file-lines`, but override EOL to be CR+LF in 
the output?
  If not, what's the alternative solution?

---=--- 
 Александр

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk