diff options
author | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2025-05-31 06:12:28 +0330 |
---|---|---|
committer | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2025-05-31 06:12:28 +0330 |
commit | faf462fe49bf642866175d842a98d721f8f66208 (patch) | |
tree | 9fda469f61e9ea534bb072a49703f736c656fdb4 /code/main.felan | |
parent | 14c9e2b60f686407dbe7218658809d768351d345 (diff) |
fixing some problems with array access
Diffstat (limited to 'code/main.felan')
-rw-r--r-- | code/main.felan | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/code/main.felan b/code/main.felan index 3e98896..5b0c634 100644 --- a/code/main.felan +++ b/code/main.felan @@ -10,21 +10,12 @@ print :: (value:**anytype)->void{ } }; -__get_item__ :: (left:*anytype,index:i64) -> (@type_of(left.*)) { - return (left + index).*; -}; - -__set_item__ :: (left:*anytype,index:i64,item:@type_of(left.*)) -> (@type_of(left.*)) { - return (left + index).* = item; -}; - -__get_item_address__ :: (left:*anytype,index:i64,item:@type_of(left.*)) -> (@type_of(left)) { - return (left + index); -}; - main :: () -> void { a := @stack_alloc(10,u8); a[0] = '1'; + b := &a[2]; + b.* = '9'; @putc(a[0]); + @putc(b.*); }; |