-
Notifications
You must be signed in to change notification settings - Fork 72
Expose a platform-specific line separator #449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
|
Hmm @fzhinkin will this get merged soon? |
d878fa0 to
4a8e612
Compare
| try { | ||
| os.EOL | ||
| } catch (_: Throwable) { | ||
| "\r\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it somehow justified that we use \r\n as a fallback?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HTML uses CRLF as a line separator, so I thought it's a good idea to fall back to it. But it has to be explicitly specified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, wait, it's already documented and says that the separator is different :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JSMonk does such a choice make any sense? Or it's better to use \n?
| package kotlinx.io | ||
|
|
||
| /** | ||
| * Sequence of characters used as a line separator by the underlying platform. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's better to explicitly write about it in a specific platform, like:
Sequence of characters used as a line separator in Apple targets?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer having the same brief kdoc line across all actualizations, and only add platform specific details in the expanded version of a doc. But that's a personal preference, I don't have strong arguments to support it (docs will be different anyway). So we can try your suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Depending on the target, I tend to end the phrase "Sequence of characters used as a line separator ... " with:
- "... in JS environments"
- "... by Windows"
- "... on Apple targets"
- "... by Unix platforms"
- "... by the JVM"
WDYT? The lack of consistency bugs me, and writing "on XXX targets" everywhere feels off.
Closes #448