Skip to content

Commit cc62dd4

Browse files
committed
fix(docs): correct code examples and language name typo
- control-flow.md: fix "In Rain" → "In Radon" - data-types.md: add missing `var` declarations in array examples - loops.md: add missing `var` on loop counter in while_break example - classes.md: add missing `const` on Person instantiation example - arrays.md: add missing `const` on Array stdlib usage example All bare assignments (x = ...) have been updated to use the proper `var`/`const` declaration keyword so examples match idiomatic Radon.
1 parent 08efdf6 commit cc62dd4

5 files changed

Lines changed: 8 additions & 8 deletions

File tree

docs/arrays.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ print(arr1 * 2) # [1, 2, 3, 1, 2, 3]
7474
import array # Include the array standard library
7575
7676
# Create an array instance using the Array class
77-
arr = array.Array([1, 2, 3, 4, 5])
77+
const arr = array.Array([1, 2, 3, 4, 5])
7878
7979
print(len(arr)) # 5
8080
print(arr.is_empty()) # false

docs/classes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class Person {
6767
}
6868
}
6969
70-
person = Person("John", 20)
70+
const person = Person("John", 20)
7171
person.say_hello() # Output: Hello, John!
7272
```
7373

docs/control-flow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Conditional statements
44

5-
Conditional statements are used to execute code based on a condition. In Rain,
5+
Conditional statements are used to execute code based on a condition. In Radon,
66
the `if` statement is used to execute code if a condition is true. The `else`
77
statement is used to execute code if the condition is false. The `elif`
88
statement is used to execute code if the condition is false and another

docs/data-types.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ Arrays are declared using the `[]` syntax. The type of the array is the type
1414
of the elements it contains.
1515

1616
```rn linenums="1" title="arrays.rn"
17-
a = [1, 2, 3] # a is an array of numbers
18-
c = ["a", "b", "c"] # c is an array of strings
17+
var a = [1, 2, 3] # a is an array of numbers
18+
var c = ["a", "b", "c"] # c is an array of strings
1919
2020
# Arrays can be nested
21-
d = [[1, 2], [3, 4]] # d is an array of arrays of ints
21+
var d = [[1, 2], [3, 4]] # d is an array of arrays of ints
2222
2323
# Arrays can be empty
24-
e = [] # e is an empty array of unknown type
24+
var e = [] # e is an empty array of unknown type
2525
```
2626

2727
## Hashmaps

docs/loops.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ for i=0 to 10 {
179179
While loop example:
180180

181181
```rn linenums="1" title="while_break.rn"
182-
i = 0
182+
var i = 0
183183
while i < 10 {
184184
if i == 5 {
185185
break

0 commit comments

Comments
 (0)