Skip to content

docs: Fixing a few typos#18379

Merged
medvednikov merged 1 commit intovlang:masterfrom
AntonioNoack:master
Jun 10, 2023
Merged

docs: Fixing a few typos#18379
medvednikov merged 1 commit intovlang:masterfrom
AntonioNoack:master

Conversation

@AntonioNoack
Copy link
Copy Markdown
Contributor

I noticed a few things while reading the docs:

  1. "casted" doesn't exist, it's called "cast";
  2. In line 518, I believe the comment should be about "y", not about "x". "x" is clearly declared as f32 in the line above.

"casted" doesn't exist, it's called "cast";
In line 518, I believe the comment should be about "y", not "x"
Comment thread doc/docs.md
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
Copy link
Copy Markdown
Member

@medvednikov medvednikov Jun 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, this one it's often not marked as typo by spell checkers.

@ttytm ttytm mentioned this pull request Jun 9, 2023
Comment thread doc/docs.md
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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good find

@medvednikov medvednikov merged commit c4a20f0 into vlang:master Jun 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants