summaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
authorA404M <ahmadmahmoudiprogrammer@gmail.com>2025-04-07 16:53:53 +0330
committerA404M <ahmadmahmoudiprogrammer@gmail.com>2025-04-07 16:53:53 +0330
commit92bf7bf5de203eac51befc914dfddbc29d49351b (patch)
tree645448cbedf2d0cc9b3b39651daf1d069c80015a /code
parent62b7af496f2c694ff5361cf21042bbe14f969c64 (diff)
add a way to make generic structs
Diffstat (limited to 'code')
-rw-r--r--code/main.felan14
1 files changed, 11 insertions, 3 deletions
diff --git a/code/main.felan b/code/main.felan
index 52c8933..667adbe 100644
--- a/code/main.felan
+++ b/code/main.felan
@@ -24,10 +24,18 @@ array :: (t:type) -> type {
};
};
+array2 :: (t:type) -> type {
+ return struct {
+ ptr : *t;
+ length : usize;
+ };
+};
+
array_int :: array(u64);
+array_int1 :: array(u64);
+array_int2 :: array2(u64);
main :: () -> void {
- a : array_int = undefined;
- b :u64 =2;
- a.length = 1;
+ print_u64 (if array_int == array_int1 1 else 0);
+ print_u64 (if array_int == array_int2 1 else 0);
};