Skip to content

Commit 5ae1b3a

Browse files
authored
Merge pull request #423 from lunargon/update-install
Update https://developer.aleo.org/leo/resources
2 parents 894237a + cf25bac commit 5ae1b3a

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

documentation/leo/07_resources.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ https://discord.gg/aleo
2424

2525
### Looking for [More Aleo Resources?](../00_getting_started.md)
2626

27-
# Style Guide
27+
## Style Guide
2828

2929

3030
This guide is provided to point developers in the right direction when writing Leo code.
31-
There are many conventions that are unique to Leo language and the circuits it generates.
31+
There are many conventions that are unique to the Leo language and the circuits it generates.
3232

3333
This guide is a living document.
3434
As new Leo programming conventions arise and old ones become obsolete this guide should reflect the changes.
@@ -90,7 +90,6 @@ program prog.aleo {
9090
| Function Parameters | snake_case |
9191
| Variables | snake_case |
9292
| Inputs | snake_case |
93-
```
9493

9594
### Layout
9695
Leo file elements should be ordered:
@@ -100,6 +99,7 @@ Leo file elements should be ordered:
10099
4. Records + Structs
101100
5. Functions + Transitions
102101

102+
103103
### Braces
104104
Opening braces always go on the same line.
105105
```leo
@@ -121,7 +121,7 @@ let a: u32 = 1u32;
121121
let b: u32 = a + 5u32;
122122
b *= 2u32;
123123
124-
return b
124+
return b;
125125
```
126126

127127
### Commas
@@ -148,14 +148,14 @@ For precise control over the circuit size, it is recommended to use ternary expr
148148

149149
```leo title="Example:"
150150
if (condition) {
151-
return a
151+
return a;
152152
} else {
153-
return b
153+
return b;
154154
}
155155
```
156156

157157
```leo title="Alternative:"
158-
return condition ? a : b
158+
return condition ? a : b;
159159
```
160160

161161
#### Why?
@@ -168,11 +168,11 @@ We cannot resolve the return statements before evaluating the condition.
168168
As a solution, Leo creates branches in the circuit so both paths can be evaluated.
169169

170170
```leo title="branch 1, condition = true"
171-
return a
171+
return a;
172172
```
173173

174174
```leo title="branch 2, condition = false"
175-
return b
175+
return b;
176176
```
177177
When the input value `condition` is fetched at proving time, we select a branch of the circuit to evaluate.
178178
Observe that the statement `return a` is repeated in both branches.

0 commit comments

Comments
 (0)