rfc:println
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:println [2021/03/13 19:16] – tandre | rfc:println [2021/03/15 13:26] (current) – tandre | ||
---|---|---|---|
Line 3: | Line 3: | ||
* Date: 2021-03-13 | * Date: 2021-03-13 | ||
* Author: Tyson Andre | * Author: Tyson Andre | ||
- | * Status: | + | * Status: |
* First Published at: http:// | * First Published at: http:// | ||
+ | * Implementation: | ||
===== Introduction ===== | ===== Introduction ===== | ||
Line 23: | Line 24: | ||
The behavior is equivalent to the following polyfill but expected to be more efficient due to avoiding concatenation. | The behavior is equivalent to the following polyfill but expected to be more efficient due to avoiding concatenation. | ||
- | Similarly to https:// | + | Similarly to https:// |
Line 179: | Line 180: | ||
Within HTML, there are elements such as ''< | Within HTML, there are elements such as ''< | ||
- | ===== Proposed Voting Choices | + | ==== Choice of println for the name ==== |
- | Yes/No, requiring 2/3 majority. | + | |
- | ===== References ===== | + | Naming was discussed in a different user's proposal to add a " |
- | https://externals.io/message/104545 "print with newline" | + | |
- | ===== Rejected Features ===== | + | < |
+ | nikic commented on 14 Jun 2019 | ||
- | ==== Alternate names ==== | + | > Inspiration from Rust: https:// |
- | '' | + | Speaking of ... I think it would make a lot more sense to call this function |
- | anyone without a C background. | + | </ |
+ | |||
+ | As stated in that comment, | ||
Additionally, | Additionally, | ||
(e.g. changing '' | (e.g. changing '' | ||
+ | |||
+ | ==== Choice of Unix newline(\n) ==== | ||
+ | |||
+ | Some programming languages such as Java use a platform-specific or configurable newline https:// | ||
+ | Others, such as rust and golang, always use a unix newline. | ||
+ | |||
+ | There have been some comments in favor of Unix newlines, and other comments in favor of PHP_EOL or configurable settings - e.g. https:// | ||
+ | |||
+ | My reasons for unconditionally choosing the Unix newline are documented in the section [[# | ||
+ | |||
+ | ==== Should this be a language construct instead ==== | ||
+ | |||
+ | |||
+ | https:// | ||
+ | |||
+ | < | ||
+ | Should' | ||
+ | |||
+ | It would feel a little weird being able to do: | ||
+ | |||
+ | <code php> | ||
+ | echo 'hello world'; | ||
+ | print 'hello world'; | ||
+ | </ | ||
+ | ... but not: | ||
+ | |||
+ | <code php> | ||
+ | puts 'hello world'; | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | Adding this as a language construct (i.e. new statement type) is something I'd expect to be contentious, | ||
+ | |||
+ | - Cause a larger BC break. | ||
+ | - Increase the complexity of the language specification and make the language a bit harder to learn; I'd prefer simplicity by using an ordinary global function in this case. | ||
+ | - Be impossible to polyfill (when brackets weren' | ||
+ | |||
+ | ==== PHP already has a lot of ways to print a string ==== | ||
+ | |||
+ | https:// | ||
+ | |||
+ | < | ||
+ | This isn't solving any problem that anyone is actually having. | ||
+ | Yes, that includes you. You're not having this problem because it doesn' | ||
+ | exist. | ||
+ | |||
+ | We already have twice as many ways to output a string as any language needs | ||
+ | and you want to add another because you'd rather type " | ||
+ | Hard, negative ten thousand no on this. | ||
+ | This is genuinely absurd. | ||
+ | </ | ||
+ | |||
+ | ===== Proposed Voting Choices ===== | ||
+ | Yes/No, requiring a 2/3 majority. | ||
+ | |||
+ | ===== References ===== | ||
+ | https:// | ||
+ | |||
+ | https:// |
rfc/println.1615662979.txt.gz · Last modified: 2021/03/13 19:16 by tandre