docs: fix minor typo

pull/4774/head
yuyi 2020-05-07 21:36:34 +08:00 committed by GitHub
parent d0afa748ff
commit ab30e81ab5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -11,7 +11,7 @@ and by the end of it you will have pretty much learned the entire language.
The language promotes writing simple and clear code with minimal abstraction. The language promotes writing simple and clear code with minimal abstraction.
Despite being simple, V gives the devloper a lot of power. Anything you can do in other languages, Despite being simple, V gives the developer a lot of power. Anything you can do in other languages,
you can do in V. you can do in V.
@ -717,13 +717,13 @@ fn run(value int, op fn(int) int) int {
fn main() { fn main() {
println(run(5, sqr)) // "25" println(run(5, sqr)) // "25"
// Anonymous functions can be declared inside other functions: // Anonymous functions can be declared inside other functions:
double_fn := fn(n int) int { double_fn := fn(n int) int {
return n + n return n + n
} }
println(run(5, double_fn)) // "10" println(run(5, double_fn)) // "10"
// Functions can be passed around without assigning them to variables: // Functions can be passed around without assigning them to variables:
res := run(5, fn(n int) int { res := run(5, fn(n int) int {
return n + n return n + n
@ -952,7 +952,7 @@ println(color) // "1" TODO: print "green"?
## Sum types ## Sum types
```v ```v
type Expr = BinaryExpr | UnaryExpr | IfExpr type Expr = BinaryExpr | UnaryExpr | IfExpr
struct BinaryExpr{ ... } struct BinaryExpr{ ... }
struct UnaryExpr{ ... } struct UnaryExpr{ ... }