Commit 2d02cfd 1 parent 4a321c1 commit 2d02cfd Copy full SHA for 2d02cfd
File tree 12 files changed +71
-11
lines changed
12 files changed +71
-11
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ fn main() {
9
9
let mut home = home_dir ( ) . unwrap ( ) ;
10
10
home. push ( "leadLang" ) ;
11
11
12
- let folder = Text :: new ( & "Where shall we install lead?" )
12
+ let _ = Text :: new ( & "Where shall we install lead?" )
13
13
. with_default ( & home. to_str ( ) . unwrap ( ) )
14
14
. prompt ( )
15
15
. unwrap ( ) ;
Original file line number Diff line number Diff line change 2
2
- ** From:** 📦 Core / Array
3
3
4
4
## Description
5
- ""
5
+ Allocate an array in memory
6
+ ## Format:
7
+ ```
8
+ $var: array::alloc
9
+ ```
10
+
Original file line number Diff line number Diff line change 2
2
- ** From:** 📦 Core / Array
3
3
4
4
## Description
5
- ""
5
+ Push a value to an array
6
+ ## Format:
7
+ ```
8
+ array::push ->&$array ->$val
9
+ ```
10
+
11
+ ## Example:
12
+ ```
13
+ $var: array::malloc
14
+ $to_push: malloc string Hello
15
+
16
+ array::push ->&$var ->$to_push
17
+ ```
Original file line number Diff line number Diff line change 2
2
- ** From:** 📦 Core / Array
3
3
4
4
## Description
5
- ""
5
+ Push if capacity available
6
+ ## Format:
7
+ ```
8
+ array::push_if_cap_available ->&array ->$val
9
+ ```
10
+
11
+ ⚠️ It may reject silent if size isn't within capacity, not recommended
Original file line number Diff line number Diff line change 2
2
- ** From:** 📦 Core / Array
3
3
4
4
## Description
5
- ""
5
+ Removes the last element from an array & returns it
6
+ ## Format:
7
+ ```
8
+ # If you want to discard the result
9
+ array::pop ->&$array
10
+
11
+ # If you want to collect it
12
+ $var: array::pop ->&$array
13
+ ```
Original file line number Diff line number Diff line change 2
2
- ** From:** 📦 Core / Array
3
3
4
4
## Description
5
- ""
5
+ Returns the length of the array
6
+ ## Format:
7
+ ```
8
+ $len: array::len ->&$array
9
+ ```
Original file line number Diff line number Diff line change 1
- # array::capacity
1
+ # array::cap
2
2
- ** From:** 📦 Core / Array
3
3
4
4
## Description
5
- ""
5
+ Returns the capacity of the array
6
+ ## Format:
7
+ ```
8
+ $len: array::cap ->&$array
9
+ ```
Original file line number Diff line number Diff line change 2
2
- ** From:** 📦 Core / Array
3
3
4
4
## Description
5
- ""
5
+ Completely clears the array
6
+ ## Format:
7
+ ```
8
+ array::clear ->&array
9
+ ```
10
+
11
+ ## Note:
12
+ It is advisable to drop() the array if you want to clear it from memory
Original file line number Diff line number Diff line change
1
+ # array::get
2
+ - ** From:** 📦 Core / Array
3
+
4
+ ## Description
5
+ Gets a pointer reference to an element of an array
6
+ ## Format:
7
+ ```
8
+ *val: array::get ->&array 1
9
+ *val: array::get ->&array 32
10
+
11
+ -- OR --
12
+ *val: array::get ->&array $index
13
+ ```
Original file line number Diff line number Diff line change 1
1
# 📦 Core / Array
2
- - 7 &'static Methods
2
+ - 8 &'static Methods
3
3
- 0 &'a dyn Methods
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ array::push->./docs/2/2
9
9
array::push_if_cap_available->./docs/2/3
10
10
array::pop->./docs/2/4
11
11
array::len->./docs/2/5
12
- array::capacity ->./docs/2/6
12
+ array::cap ->./docs/2/6
13
13
array::clear->./docs/2/7
14
+ array::get->./docs/2/8
14
15
str::to_int->./docs/3/1
You can’t perform that action at this time.
0 commit comments