Adding len() builtin and TYPE_SLICE

This commit is contained in:
Krzosa Karol
2022-06-14 09:33:46 +02:00
parent 1a6d2598a3
commit f189ca381e
6 changed files with 65 additions and 19 deletions

View File

@@ -1,8 +1,16 @@
#import "base.kl"
test_arrays :: ()
array := [4]int{1,2,3,4}
item := array[0]
length := len(array)
slice: []int = array
slice_length := len(slice)
main :: (argc: int, argv: **char): int
memory := reserve(size = 10000)
handle := Windows.GetStdHandle(Windows.STD_OUTPUT_HANDLE)
string: *char = "hello world"
Windows.WriteConsoleA(handle, string->*void, 11, 0, 0)