Baby steps struct polymorphs

This commit is contained in:
Krzosa Karol
2023-03-29 21:36:26 +02:00
parent 58a46b46e6
commit 21c8ceff03
6 changed files with 85 additions and 33 deletions

View File

@@ -5,11 +5,6 @@ PushStruct :: (a: *MA.Arena, $T: Type): *$T
result := PushSize(a, size)
return result
Array :: struct($T: Type)
data: *T
len: int
cap: int
Array(int)
QueueAddSLL(list: $List, node: $Node, first: #Identifier = first, last: #Identifier = last, next: #Identifier = next)
@@ -24,6 +19,10 @@ QueueAddSLL(list: $List, node: $Node, $first = first, $last = last, $next = next
*/
Array :: struct($T: Type)
data: *T
len: int
cap: int
main :: (argc: int, argv: **char): int
$i := 10
return 0