Skip to content

Commit a7f772e

Browse files
Fix typos
1 parent fe1875c commit a7f772e

File tree

6 files changed

+10
-12
lines changed

6 files changed

+10
-12
lines changed

docs/language/arrays.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ In the provided code snippet, we can see how arrays work:
99
```mew
1010
let foo = new string[] { "A", "B", "C" };
1111
12-
let bar = i32[4];
12+
let mut bar = i32[4];
1313
bar[0] = 0;
1414
bar[1] = 1;
1515
bar[2] = 2;
@@ -27,7 +27,7 @@ let foo = new string[] { "A", "B", "C" };
2727
This line declares an array of type `string` and initializes it with three string elements "A", "B", and "C". In Mew, arrays can be initialized with values directly using the curly braces syntax.
2828

2929
```mew
30-
let bar = new i32[4];
30+
let mut bar = new i32[4];
3131
```
3232

3333
This line declares an array of type `i32`, specifying the size of the array as 4. The array is created, but it is initially empty.

docs/language/assignment.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ to be an integer `i32`, but in cases where you
1515
want to be explicit, you can specify the type.
1616

1717
```mew
18-
let x : i16 = 1;
18+
let x: i16 = 1;
1919
```
2020

2121
### Mutability
@@ -27,7 +27,5 @@ use the `mut` keyword.
2727
```mew
2828
let mut x = 1;
2929
x = 2; // Variable can now be updated
30-
31-
print(x) // => 2
3230
```
3331

docs/language/casting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ sidebar_position: 50
99
// it with the value 32. The type of `i` is specified as any
1010
// which means it can hold values of any data type.
1111
// In this case, it holds an integer value.
12-
let i : any = 32;
12+
let i: any = 32;
1313
1414
// This line attempts to cast the value stored in `i` to the
1515
// data type `i32` which is a signed 32-bit integer.
16-
let j = i as i32;
16+
let j= i as i32;
1717
```
1818

1919
In summary, casting in this code snippet involves converting a value from the generic `any` type to the specific `i32` type, ensuring that the variable `j` is of the desired data type. This casting operation is possible because the original value in `i` is compatible with the target data type `i32`.

docs/language/control/loops.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ sidebar_position: 20
88
### `loop`
99

1010
```mew
11-
let foo = 0;
11+
let mut foo = 0;
1212
loop {
1313
if foo < 100 {
1414
foo = foo + 1;
@@ -22,7 +22,7 @@ loop {
2222
### `while`
2323

2424
```mew
25-
let foo = 0;
25+
let mut foo = 0;
2626
while foo < 100 {
2727
foo = foo + 1;
2828
}

docs/language/primitives/any.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ sidebar_position: 30
66
# Any
77

88
```mew
9-
let foo : any = 32;
9+
let foo: any = 32;
1010
```

docs/language/types.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ All fields must be initialized when creating a class.
1212

1313
```mew
1414
pub type Person {
15-
pub field name : string;
15+
pub field name: string;
1616
}
1717
```
1818

@@ -65,7 +65,7 @@ one or more static methods; by convention called `new`.
6565

6666
```mew
6767
pub type Person {
68-
pub field name : string;
68+
pub field name: string;
6969
7070
pub static fn new(name: string) -> Person {
7171
return Person(name: name)

0 commit comments

Comments
 (0)