Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/docs/language_concepts/01_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ All parameters in a function must have a type and all types are known at compile
is pre-pended with a colon and the parameter type. Multiple parameters are separated using a comma.

```rust
fn foo(x : Field, y : pub Field){}
fn foo(x : Field, y : Field){}
```

The return type of a function can be stated by using the `->` arrow notation. The function below
states that the foo function must return a `Field`. If the function returns no value, then the arrow
is omitted.

```rust
fn foo(x : Field, y : pub Field) -> Field {
fn foo(x : Field, y : Field) -> Field {
x + y
}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/language_concepts/07_mutability.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Note that mutability in noir is local and everything is passed by value, so if a
mutates its parameters then the parent function will keep the old value of the parameters.

```rust
fn main() -> Field {
fn main() -> pub Field {
let x = 3;
helper(x);
x // x is still 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ All parameters in a function must have a type and all types are known at compile
is pre-pended with a colon and the parameter type. Multiple parameters are separated using a comma.

```rust
fn foo(x : Field, y : pub Field){}
fn foo(x : Field, y : Field){}
```

The return type of a function can be stated by using the `->` arrow notation. The function below
states that the foo function must return a `Field`. If the function returns no value, then the arrow
is omitted.

```rust
fn foo(x : Field, y : pub Field) -> Field {
fn foo(x : Field, y : Field) -> Field {
x + y
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Note that mutability in noir is local and everything is passed by value, so if a
mutates its parameters then the parent function will keep the old value of the parameters.

```rust
fn main() -> Field {
fn main() -> pub Field {
let x = 3;
helper(x);
x // x is still 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ All parameters in a function must have a type and all types are known at compile
is pre-pended with a colon and the parameter type. Multiple parameters are separated using a comma.

```rust
fn foo(x : Field, y : pub Field){}
fn foo(x : Field, y : Field){}
```

The return type of a function can be stated by using the `->` arrow notation. The function below
states that the foo function must return a `Field`. If the function returns no value, then the arrow
is omitted.

```rust
fn foo(x : Field, y : pub Field) -> Field {
fn foo(x : Field, y : Field) -> Field {
x + y
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Note that mutability in noir is local and everything is passed by value, so if a
mutates its parameters then the parent function will keep the old value of the parameters.

```rust
fn main() -> Field {
fn main() -> pub Field {
let x = 3;
helper(x);
x // x is still 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ All parameters in a function must have a type and all types are known at compile
is pre-pended with a colon and the parameter type. Multiple parameters are separated using a comma.

```rust
fn foo(x : Field, y : pub Field){}
fn foo(x : Field, y : Field){}
```

The return type of a function can be stated by using the `->` arrow notation. The function below
states that the foo function must return a `Field`. If the function returns no value, then the arrow
is omitted.

```rust
fn foo(x : Field, y : pub Field) -> Field {
fn foo(x : Field, y : Field) -> Field {
x + y
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Note that mutability in noir is local and everything is passed by value, so if a
mutates its parameters then the parent function will keep the old value of the parameters.

```rust
fn main() -> Field {
fn main() -> pub Field {
let x = 3;
helper(x);
x // x is still 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ All parameters in a function must have a type and all types are known at compile
is pre-pended with a colon and the parameter type. Multiple parameters are separated using a comma.

```rust
fn foo(x : Field, y : pub Field){}
fn foo(x : Field, y : Field){}
```

The return type of a function can be stated by using the `->` arrow notation. The function below
states that the foo function must return a `Field`. If the function returns no value, then the arrow
is omitted.

```rust
fn foo(x : Field, y : pub Field) -> Field {
fn foo(x : Field, y : Field) -> Field {
x + y
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Note that mutability in noir is local and everything is passed by value, so if a
mutates its parameters then the parent function will keep the old value of the parameters.

```rust
fn main() -> Field {
fn main() -> pub Field {
let x = 3;
helper(x);
x // x is still 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ All parameters in a function must have a type and all types are known at compile
is pre-pended with a colon and the parameter type. Multiple parameters are separated using a comma.

```rust
fn foo(x : Field, y : pub Field){}
fn foo(x : Field, y : Field){}
```

The return type of a function can be stated by using the `->` arrow notation. The function below
states that the foo function must return a `Field`. If the function returns no value, then the arrow
is omitted.

```rust
fn foo(x : Field, y : pub Field) -> Field {
fn foo(x : Field, y : Field) -> Field {
x + y
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Note that mutability in noir is local and everything is passed by value, so if a
mutates its parameters then the parent function will keep the old value of the parameters.

```rust
fn main() -> Field {
fn main() -> pub Field {
let x = 3;
helper(x);
x // x is still 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ All parameters in a function must have a type and all types are known at compile
is pre-pended with a colon and the parameter type. Multiple parameters are separated using a comma.

```rust
fn foo(x : Field, y : pub Field){}
fn foo(x : Field, y : Field){}
```

The return type of a function can be stated by using the `->` arrow notation. The function below
states that the foo function must return a `Field`. If the function returns no value, then the arrow
is omitted.

```rust
fn foo(x : Field, y : pub Field) -> Field {
fn foo(x : Field, y : Field) -> Field {
x + y
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Note that mutability in noir is local and everything is passed by value, so if a
mutates its parameters then the parent function will keep the old value of the parameters.

```rust
fn main() -> Field {
fn main() -> pub Field {
let x = 3;
helper(x);
x // x is still 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ All parameters in a function must have a type and all types are known at compile
is pre-pended with a colon and the parameter type. Multiple parameters are separated using a comma.

```rust
fn foo(x : Field, y : pub Field){}
fn foo(x : Field, y : Field){}
```

The return type of a function can be stated by using the `->` arrow notation. The function below
states that the foo function must return a `Field`. If the function returns no value, then the arrow
is omitted.

```rust
fn foo(x : Field, y : pub Field) -> Field {
fn foo(x : Field, y : Field) -> Field {
x + y
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Note that mutability in noir is local and everything is passed by value, so if a
mutates its parameters then the parent function will keep the old value of the parameters.

```rust
fn main() -> Field {
fn main() -> pub Field {
let x = 3;
helper(x);
x // x is still 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ All parameters in a function must have a type and all types are known at compile
is pre-pended with a colon and the parameter type. Multiple parameters are separated using a comma.

```rust
fn foo(x : Field, y : pub Field){}
fn foo(x : Field, y : Field){}
```

The return type of a function can be stated by using the `->` arrow notation. The function below
states that the foo function must return a `Field`. If the function returns no value, then the arrow
is omitted.

```rust
fn foo(x : Field, y : pub Field) -> Field {
fn foo(x : Field, y : Field) -> Field {
x + y
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Note that mutability in noir is local and everything is passed by value, so if a
mutates its parameters then the parent function will keep the old value of the parameters.

```rust
fn main() -> Field {
fn main() -> pub Field {
let x = 3;
helper(x);
x // x is still 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ All parameters in a function must have a type and all types are known at compile
is pre-pended with a colon and the parameter type. Multiple parameters are separated using a comma.

```rust
fn foo(x : Field, y : pub Field){}
fn foo(x : Field, y : Field){}
```

The return type of a function can be stated by using the `->` arrow notation. The function below
states that the foo function must return a `Field`. If the function returns no value, then the arrow
is omitted.

```rust
fn foo(x : Field, y : pub Field) -> Field {
fn foo(x : Field, y : Field) -> Field {
x + y
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Note that mutability in noir is local and everything is passed by value, so if a
mutates its parameters then the parent function will keep the old value of the parameters.

```rust
fn main() -> Field {
fn main() -> pub Field {
let x = 3;
helper(x);
x // x is still 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ All parameters in a function must have a type and all types are known at compile
is pre-pended with a colon and the parameter type. Multiple parameters are separated using a comma.

```rust
fn foo(x : Field, y : pub Field){}
fn foo(x : Field, y : Field){}
```

The return type of a function can be stated by using the `->` arrow notation. The function below
states that the foo function must return a `Field`. If the function returns no value, then the arrow
is omitted.

```rust
fn foo(x : Field, y : pub Field) -> Field {
fn foo(x : Field, y : Field) -> Field {
x + y
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Note that mutability in noir is local and everything is passed by value, so if a
mutates its parameters then the parent function will keep the old value of the parameters.

```rust
fn main() -> Field {
fn main() -> pub Field {
let x = 3;
helper(x);
x // x is still 3
Expand Down