Skip to content

Commit a78bb07

Browse files
authored
Merge pull request #478 from ProvableHQ/rr-CamelCase-for-all-Records
Update Record and Struct names to use CamelCase format
2 parents 14ab476 + 9441659 commit a78bb07

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

documentation/language/02_structure.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@ program hello.aleo {
2525
const FOO: u64 = 1u64;
2626
mapping account: address => u64;
2727
28-
record token {
28+
record Token {
2929
owner: address,
3030
amount: u64,
3131
}
3232
33-
struct message {
33+
struct Message {
3434
sender: address,
3535
object: u64,
3636
}
3737
3838
async transition mint_public(
3939
public receiver: address,
4040
public amount: u64,
41-
) -> (token, Future) {
42-
return (token {
41+
) -> (Token, Future) {
42+
return (Token {
4343
owner: receiver,
4444
amount,
4545
}, update_state(receiver, amount));
@@ -138,7 +138,7 @@ A struct data type is declared as `struct {name} {}`.
138138
Structs contain component declarations `{name}: {type},`.
139139

140140
```leo showLineNumbers
141-
struct array3 {
141+
struct Array3 {
142142
a0: u32,
143143
a1: u32,
144144
a2: u32,
@@ -158,7 +158,7 @@ When passing a record as input to a program function, the `_nonce: group` compon
158158
(but it does not need to be declared in the Leo program).
159159

160160
```aleo showLineNumbers
161-
record token {
161+
record Token {
162162
// The token owner.
163163
owner: address,
164164
// The token amount.

documentation/language/03_data_types.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,25 +138,25 @@ let arr: [bool; 4] = [true, false, true, false];
138138
// Nested array
139139
let nested: [[bool; 2]; 2] = [[true, false], [true, false]];
140140
141-
struct bar {
141+
struct Bar {
142142
data: u8,
143143
}
144144
145145
// Array of structs
146-
let arr_of_structs: [bar; 2] = [bar { data: 1u8 }, bar { data: 2u8 }];
146+
let arr_of_structs: [Bar; 2] = [Bar { data: 1u8 }, Bar { data: 2u8 }];
147147
148148
// Access the field of a struct within an array
149-
transition foo(a: [bar; 8]) -> u8 {
149+
transition foo(a: [Bar; 8]) -> u8 {
150150
return a[0u8].data;
151151
}
152152
153153
// Struct that contains an array
154-
struct bat {
154+
struct Bat {
155155
data: [u8; 8],
156156
}
157157
158158
// Record that contains an array
159-
record floo {
159+
record Floo {
160160
owner: address,
161161
data: [u8; 8],
162162
}

documentation/language/08_cheatsheet.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ You can cast an `address` to a `field` but not vice versa.
7676
## 4. Records
7777
Defining a `record`
7878
```leo
79-
record token {
79+
record Token {
8080
owner: address,
8181
amount: u64,
8282
}
@@ -99,7 +99,7 @@ let user_balance: u64 = user.balance;
9999
## 5. Structs
100100
Defining a `struct`
101101
```leo
102-
struct message {
102+
struct Message {
103103
sender: address,
104104
object: u64,
105105
};
@@ -174,7 +174,7 @@ let third: field = t.2;
174174
transition mint_public(
175175
public receiver: address,
176176
public amount: u64,
177-
) -> token { /* Your code here */ }
177+
) -> Token { /* Your code here */ }
178178
```
179179

180180
## 9. Functions

0 commit comments

Comments
 (0)