docs: Fixing a few typos#18379
Conversation
"casted" doesn't exist, it's called "cast"; In line 518, I believe the comment should be about "y", not "x"
| x := Alphabet(Abc{'test'}) // sum type | ||
| if x is Abc { | ||
| // x is automatically casted to Abc and can be used here | ||
| // x is automatically cast to Abc and can be used here |
There was a problem hiding this comment.
The verb cast is conventionally uninflected in the past tense and as a past participle. Casted is an old form—examples are easily found in texts from every century from the 14th to the present—but it has given way to cast in modern English. In current usage, however, casted is gaining ground, especially where cast means either (1) to assemble actors for a performance, or (2) to throw out bait and/or a lure on a fishing line. (Both these senses have extended metaphorical uses where casted is likewise used at least some of the time). Many people object to casted, but that doesn’t change the fact that it is catching on and not likely to go away soon.
This form is very often used in programming to avoid confusion. For example:
https://doc.rust-lang.org/reference/items/enumerations.html
Field-less enums can be casted if they do not have explicit discriminants, or where only unit variants are explicit.
There was a problem hiding this comment.
Good point, this one it's often not marked as typo by spell checkers.
| v := 13 + u // v is of type `u16` - no promotion | ||
| x := f32(45.6) | ||
| y := x + 3.14 // x is of type `f32` - no promotion | ||
| y := x + 3.14 // y is of type `f32` - no promotion |
I noticed a few things while reading the docs: