-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
105 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
include "cores/select.cal" | ||
include "std/io.cal" | ||
include "std/vector.cal" | ||
|
||
let Vector vec | ||
cell.sizeOf &vec init_vec | ||
|
||
func vec_info begin | ||
"Capacity: " printstr vec.capacity printdec new_line | ||
"Length: " printstr vec.length printdec new_line | ||
|
||
"Contents: " printstr | ||
|
||
0 | ||
while dup vec.length < do | ||
dup &vec a@ printdec ' ' printch | ||
1 + | ||
end | ||
drop | ||
|
||
new_line new_line | ||
end | ||
|
||
"=== vec_push 1" printstr new_line | ||
1 &vec vec_push | ||
&vec vec_top printdec new_line | ||
vec_info | ||
|
||
"=== vec_push 2, 3" printstr new_line | ||
2 &vec vec_push | ||
3 &vec vec_push | ||
vec_info | ||
|
||
"=== vec_remove 1" printstr new_line | ||
1 &vec vec_remove | ||
vec_info | ||
|
||
"=== vec_insert 1, 5" printstr new_line | ||
5 1 &vec vec_insert | ||
vec_info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule std
updated
10 files
+69 −0 | cores/cs/lua.cal | |
+67 −23 | cores/os/arm64_linux.cal | |
+1 −1 | cores/os/rm86_dos.cal | |
+67 −26 | cores/os/x86_64_linux.cal | |
+110 −1 | cores/uxn.cal | |
+4 −4 | std/args.cal | |
+57 −36 | std/array.cal | |
+2 −4 | std/conv.cal | |
+2 −5 | std/io.cal | |
+96 −78 | std/vector.cal |