Closed wg21bot closed 2 years ago
Attaching a summary of the reviews (of R1: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2286r1.html)
Suggestion: use format specifiers to allow selection of printing mode:
A request to explore the feasibility of changing the API to support forwarding references in section 3.4 (3.4 What about format specifiers?) Author: I've updated the paper - this isn't feasible. If you want to format move-only non-const-iterable ranges, then you'll have to either use the join() facility or wrap it in something like ref_view(). Move-only views by themselves are fine, it's only move-only + non-const-iterable that is the problem.
A question as to which types get considered strings: Author: fmt right now detects string-like on the presence of certain operations, so arbitrary ranges of char would not be considered strings. We could probably make this a variable template instead.
A question: Do you intend to support passing format specifiers for elements, for example formatting vector of dates? Author: Directly formatting ranges, no. With fmt::join, yes.
Discussion about formatting: Victor Zverovich (fmt lib) have added his input:
I am in favor of making ranges formattable. Regarding the representation, I'd go with option 1 ([] for ranges and () for tuples) even though it's different from what {fmt} does for the same reason as Barry mentions in the paper: My preference for avoiding {} in the formatting is largely because it’s unlikely the results here can be used directly for copying and pasting directly into initialization anyway, so the priority is simply having visual distinction for the various cases, this representation is also more common in other languages.
I wonder if it's worth exploring a separate representation for associative containers (map/unorderedmap etc) as some languages like Python do?
print({"a": 0, "b": 1}) // {'a': 0, 'b': 1}
Author: (Editor's note: In essence - yes) We could make the {unordered,flat,}map and {unordered,flat_}set formatters format like this specifically. I wouldn't want to do this for some arbitrary range of pairs, since we wouldn't really know if it's associative or not. In this case it's a clearer representation, we know they are associative containers.
Regarding std::generator, can the issue be fixed by providing a formatter specialization for it?
Author & Corentin: Once we get a generator
Action Item: There's a lot of discussion regarding the integration with fmt, I suggest this paper will be scheduled for a Telecon.
D2286R2: Formatting Ranges
2021-07-20 Library Evolution Telecon Minutes
Chair: Inbal Levi
Champion: Barry Revzin
Minute Taker: Ben Craig
Start Discussion: 2021-07-20 10:10 Pacific
End Discussion: 2021-07-20 11:05 Pacific
During the discussion, three major topics came up:
std::format takes arguments by reference to const, this will limit the usability as specified in section: 3.5 How to support those views which are not const-iterable?
.
Victor (implementer of std::fmt, on which std::format is based on) have suggested changing this in the past and got weak objections.
Action Item: Send a concrete suggestion to DR change in LEWG's mailing list. If feedback is positive, we'll vote on the
change, and the change should be ported to P2286
accordingly.
There was a proposed alternative for the printed format for map-like associative containers by Victor:
std::map<std::string, char> m = {{"hello", 'h'}, {"world", 'w'}};
Would be printed as:
{“hello”: ‘h’, “world”: ‘w’}
Action Item: We took a poll, which approved this is the preferred way to print map-like associative containers.
There was a discussion regarding the concept formattable-impl
proposed in the paper. The concept was phrased to be less constraining as possible, considering std::format requirements from a formattable-impl
. The concept was phrased with the help of Tim.
Action Item: Author was requested to have additional pair of eyes to overview the concept specification.
We took the following polls:
POLL: Investigate a change for all map-like associative containers format in D2286R2 into:
std::map<std::string, char> m = {{"hello", 'h'}, {"world", 'w'}};
Would be printed as:
{“hello”: ‘h’, “world”: ‘w’}
Strongly Favor | Weakly Favor | Neutral | Weakly Against | Strongly Against |
---|---|---|---|---|
3 | 6 | 3 | 2 | 0 |
Attendance: 18
# of Authors: 1
Author's Position: N
Outcome: Weak consensus in favor
POLL: Forward next revision of D2286R2 (with the suggested changes below) to LEWG’s mailing list, and then forward to electronic polling, assuming good feedback from the mailing list.
Suggested changes:
Strongly Favor | Weakly Favor | Neutral | Weakly Against | Strongly Against |
---|---|---|---|---|
6 | 4 | 2 | 0 | 1 |
Attendance: 18
# of Authors: 1
Author Position: SF
Outcome: Consensus in favor
SA: I can’t forward something that is not finalized
The author (in cooperation with the author of fmt) will post a question regarding the investigation of std::format to take arguments by forwarding reference instead of reference to const in LEWG's mailing. Then he will change the paper accordingly, including the other recommendation specified in the second poll and will post the finalized version on the mailing list. Please also add a feature test macro.
If no strong objection will be made, the new revision (P2286R2) will be forwarded to electronic polling.
D2286R3: Formatting Ranges
2021-08-31 Library Evolution Telecon Minutes
Chair: Inbal Levi
Champion: Barry Revzin
Minute Taker: Ben Craig
The paper generally got good support. Few remarks:
The debug formatting solution presented in D2286R3 was generally supported. (Tomasz had few comments, and sent his feedback on the mail thread: "[isocpp-lib-ext] P2286 (formatting ranges): Feedback")
The specific syntax described - {:?}
was also supported.
The author was requested to address user-defined formatting in general and user-defined debug formatting in particular.
The paper will come back to LEWG when ready.
POLL: We like the debug formatting solution presented in D2286R3 (Formatting Ranges).
Strongly Favor | Weakly Favor | Neutral | Weakly Against | Strongly Against |
---|---|---|---|---|
3 | 5 | 4 | 1 | 0 |
Attendance: 19
# of Authors: 1
Author Position: WF
Outcome: Consensus in favor
WA: Covering filesystem path and alternative for format_as_map mentioned in the paper. Discuss quoted strings. Addressing those will change my vote.
POLL: We want {:?}
to do quoting escaping of the types as presented in D2286R3 (Formatting Ranges).
Strongly Favor | Weakly Favor | Neutral | Weakly Against | Strongly Against |
---|---|---|---|---|
3 | 5 | 5 | 0 | 0 |
Attendance: 19
# of Authors: 1
Author Position: N
Outcome: Consensus in favor
The author will address the issues brought up, including with the "debug" facility, and present the next revision to LEWG when available.
2021-11-22 Library Evolution Telecon minutes
Chair: Billy Baker
Champion: Barry Revzin
Minute Taker: Inbal Levi
Summary:
The feature continues to receive support.
LEWG will need to review again.
Wording is still needed.
Outcome:
Based on discussions of basic character set versus unicode for delimiters, a review from SG16 (Text processing) is needed before additional review in Library Evolution.
P2286R3: Formatting Ranges
2021-11-22 Library Evolution Telecon Minutes
Chair: Billy Baker
Champion: Barry Revzin
Minute Taker: Inbal Levi
No polls were taken, the paper needs additional discussion time (should also be reviewed by SG16).
TODO (@billy-baker)
TODO (@billy-baker)
SG16 discussed P2286R3 during its 2021-12-01 telecon. The following polls were taken:
Poll 0: We recommend using universal character name escape sequences rather than numerical escape sequences for the debug representation of all non-printable characters.
Attendance: 12
SF | F | N | A | SA |
---|---|---|---|---|
6 | 2 | 2 | 0 | 0 |
Consensus in favor
Poll 1: We recommend using brace-delimited numerical escape sequences as described in P2290 "Delimited Escape Sequences" for 'debug' formatting of invalid codeunits (including lone surrogates).
Attendance: 12
SF | F | N | A | SA |
---|---|---|---|---|
4 | 4 | 1 | 1 | 0 |
Consensus in favor
A: Delimited hex escape sequences do not exist in C++ yet and are not used elsewhere; but since they will only appear in cases of invalid code units, not SA.
Poll 2: We recommend using brace-delimited universal character name escape sequences as described in P2290 "Delimited Escape Sequences" for 'debug' formatting of strings.
Attendance: 12
SF | F | N | A | SA |
---|---|---|---|---|
3 | 3 | 4 | 0 | 0 |
Consensus in favor
SG16 discussed a draft of P2286R4 during its 2021-12-15 telecon. The following polls were taken.
Poll 2: Modify D2286R4 to address design feedback, and forward the published paper as revised to LEWG with a recommended ship vehicle of C++23.
Attendance: 10
SF | F | N | A | SA |
---|---|---|---|---|
3 | 3 | 2 | 0 | 1 |
Consensus.
N: Lack of wording.
SA: Lack of wording; concerned that there will be subtle issues that won't become apparent until wording is available.
Though SG16 elected to approve the design, I'm going to retain the SG16 label for now due to intent to review wording, assuming availability, during the SG16 telecon scheduled for 2022-01-12.
Paper was discussed in LEWG on Jan 4th 2022 (Full Minutes)
P2286R4: Formatting Ranges
Chair: Inbal Levi
Champion: Barry Revzin
Minute Taker: Ben Craig
The comments suggests the addition is supported, but request for removal of the more complex facilities (especially the ones with no implementation experience in fmt).
POLL: LEWG would like to see a revision of P2286 without the d specifier
Strongly Favor | Favor | Neutral | Against | Strongly Against |
---|---|---|---|---|
4 | 7 | 5 | 5 | 0 |
Attendance: 26
# of Authors: 1
Author Position: WA
Outcome: Weak consensus in favor
The addition was supported, but the majority of the attendees generally agreed the paper is covering a large scope, and should be reduced.
We'll see the updated revision on LEWG's meeting on 2022-01-18.
Was seen by SG9 (Ranges) on 2021-01-10 (Full Minutes).
None.
The scope of the paper was reduced as requested by LEWG. The question of diversion from "fmt" (not proposing "join") came up as well, author believe the proposed facility is more usable. Fixed wording was not reviewed at the meeting, author was advised to send the revision in SG9 / LEWG ML prior to the Jan 18th LEWG telecon.
P2286 (without user defined terminators) will continue to LEWG final review (and voting) on Jan 18th.
P2286R5: Formatting Ranges
2022-01-18 Library Evolution Telecon Minutes
Chair: Bryce Adelstein Lelbach
Champion: Barry Revzin
Minute Taker: Inbal Levi
Start: 2022-01-18 11:20 Eastern
Does this proposal have:
Should specializations of formatter
for ranges inherit from range_formatter
?
Is the intent that you can pass a vector
to any range formatter?
Answer: No.
POLL: Standard specializations of formatter
for ranges, tuples, and pairs should not be required to store separators and brackets.
Strongly Favor | Weakly Favor | Neutral | Weakly Against | Strongly Against |
---|---|---|---|---|
2 | 0 | 6 | 4 | 1 |
Attendance: 24
# of Authors: 1
Author Position: N
Outcome: No consensus.
POLL: Modify P2286R5 (Formatting Ranges) as described below and then send the revised paper to LWG for C++23 classified as an addition (priority B3), to be confirmed with a Library Evolution electronic poll.
formatter<R>::format
for ranges should take either an R&
or an
R const&
, specifically, not a template.Strongly Favor | Weakly Favor | Neutral | Weakly Against | Strongly Against |
---|---|---|---|---|
10 | 8 | 0 | 0 | 0 |
Attendance: 22
# of Authors: 1
Author Position: 1xSF
Outcome: Unanimous consensus in favor.
Submit the slides as a P document.
End: 12:09
Modify P2286R5 (Formatting Ranges) as described below and then send the revised paper to LWG for C++23 classified as an addition (priority B3), to be confirmed with a Library Evolution electronic poll.
formatter<R>::format
for ranges should take either an R&
or an
R const&
, specifically, not a template.SG16 discussed P2286R6 during its January 26th, 2022 telecon. The focus of the discussion was to review wording with the goal of identifying new concerns. No new concerns were identified and no new polls were taken. Wording feedback and suggestions were sent to the author.
The design and wording remains under specified for non-Unicode scenarios as noted in the meeting summary linked above. For that reason, I'm retaining the SG16 label pending a new revision. I anticipate that additional review or implementation experience will be needed to better inform behavior for non-Unicode scenarios.
I added the needs-revision
label to address SG16 wording feedback and the need to better address non-Unicode scenarios.
Send [P2286R6] (Formatting Ranges) to Library Working Group for C++23, classified as an addition ([P0592R4] bucket 3 item)
SF | F | N | A | SA |
---|---|---|---|---|
18 | 17 | 1 | 1 | 0 |
Consensus in favor.
LWG reviewed and approved wording on 2022-04-22 for c++23 with recheck after SG16 tweaks wording for non-unicode implementations.
https://wiki.edg.com/bin/view/Wg21telecons2022/P2286-20220422
poll: put P2286r7 into C++23?
F | A | N |
---|---|---|
12 | 0 | 1 |
SG16 will review updates and confirm direction during its 2022-04-27 telecon.
SG16 reviewed the current draft of P2286R7 during its 2022-04-27 telecon.
@JeffGarland, we are still working through some wording updates, but intend to finalize those by/during our 2022-05-11 telecon next week.
SG16 reviewed a draft of P2286R8 during its 2022-05-11 telecon. This draft addresses the concerns SG16 previously had with respect to non-Unicode scenarios being under specified. All concerns previously raised by SG16 have now been addressed.
The following poll was taken:
Removing the SG16 label; this paper is now fully in LWG's capable hands.
LWG re-reviewed on 2022-05-13 and asked for one small change from a Note to Recommended Practice. The update was reviewed live in the meeting and LWG re-affirmed support for C++23.
https://wiki.edg.com/bin/view/Wg21telecons2022/P2286-20220513
poll: put p2286r8 into C++23
F | A | N |
---|---|---|
10 | 0 | 0 |
This has been applied.
P2286R0 Formatting Ranges (Barry Revzin)