From c91d3a8893b9c53c5c8e4c5cff72d7caf44cfee4 Mon Sep 17 00:00:00 2001 From: A404M Date: Fri, 30 May 2025 22:01:19 +0330 Subject: fixing some minor issues --- code/main.felan | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'code/main.felan') diff --git a/code/main.felan b/code/main.felan index c17b965..239a201 100644 --- a/code/main.felan +++ b/code/main.felan @@ -9,14 +9,6 @@ print :: (value:**anytype)->void{ } }; -__sum__ :: (left:*anytype,right:i64) -> (@type_of(left)) { - return @add(left,right); -}; - -__sub__ :: (left:*anytype,right:i64) -> (@type_of(left)) { - return @sub(left,right); -}; - __get_item__ :: (left:*anytype,index:i64) -> (@type_of(left.*)) { return (left + index).*; }; @@ -30,13 +22,14 @@ __get_item_address__ :: (left:*anytype,index:i64,item:@type_of(left.*)) -> (@typ }; main :: ()->void{ - p := malloc(10,u64); + arr :array(@cast(10,u64),i64) = undefined; + arr.ptr = @stack_alloc(10,i64); i := 0; while i < 10 { - __set_item__(p,i,0); + __set_item__(arr.ptr,i,0); i += 1; } - print(__get_item__(p,1)); - free(@cast(p,*void)); + print(__get_item__(arr.ptr,1)); + free(@cast(arr.ptr,*void)); }; -- cgit v1.2.3