[SUGGESTION] Documentation tidbits
MaxSagebaum opened this issue · comments
Some small things, that I recognized while browsing the documentation:
Title is wrong: No Trailing commas are present. ( Title is not shown in github view.)
Line 70 in 166b59e
Should be construction:
Line 202 in 6dbd1ba
Print should be: // "value is [Jim] [(unknown)]"
Same for next line.
Line 232 in 6dbd1ba
The override method is missing its implementation.
Line 95 in 6dbd1ba
An inspect expr -> Type
expression allows pattern matching using is
.
I think for the reader it is still unclear what is expected on the right side of =
. Particularly, I think the definition is not complete. Should it not be: inspect expr -> Type { is condition = statement; ...}
My question would be: Can statement
also be a body with a return?
cppfront/docs/cpp2/expressions.md
Line 176 in d3ad31a
Thanks, good catches! Will fix.
A couple of questions:
Should be construction:
Line 202 in 6dbd1ba
Conversion can be construction and/or assignment, in this case both. But it's a good point that I should clarify this... I'll try adding "conversion from string (construction + assignment)".
Print should be: // "value is [Jim] [(unknown)]" Same for next line.
Line 232 in 6dbd1ba
Hmm, that's weird... it prints [] []
on all of the STL implementations I tried, because they clear out the source string on move. But I guess by the spec that's not actually guaranteed... "valid but unspecified state" could leave the source string unchanged, though I would find that surprising behavior. But even if the implementation didn't clear out the source string, then it should be [John] [(unknown)]
(not [Jim]
)? Which STL implementation did you try?
Hmm, that's weird... it prints [] [] on all of the STL implementations I tried, because they clear out the source string on move. But I guess by the spec that's not actually guaranteed... "valid but unspecified state" could leave the source string unchanged, though I would find that surprising behavior. But even if the implementation didn't clear out the source string, then it should be [John] [(unknown)] (not [Jim])? Which STL implementation did you try?
Sorry, this was me reading the statement wrong, I did not run it.