Add support for fixed arrays in Yaksha
Closed this issue · 1 comments
JaDogg commented
Description
Provide ability to create fixed size stack allocated arrays.
def receive_a(item_a: FixedArr[int, 3]) -> int:
item_a[0] + item_a[2]
def main() -> int:
a = fixedarr(1, 2, 3)
b = fixedarr(1, 2, 3, receive_a(a))
for (i = 0; i < len(b); i++): # <----------- len(b) simply becomes 4
println(b[i])
println(a[4]) # <------ this will result in an error
0
Links
- YAMA (proposal) link - https://yakshalang.github.io/yama/0012_fixed_size_arrays/