aboutsummaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
authorA404M <ahmadmahmoudiprogrammer@gmail.com>2025-05-30 14:56:47 +0330
committerA404M <ahmadmahmoudiprogrammer@gmail.com>2025-05-30 14:56:47 +0330
commitc8e1a4ed4885c25ffa3893afe967867852769452 (patch)
treeefde4f6d329c30fb58dd59e02e247e565c4fe75b /code
parent31637af96ec7555b81e742114ff41d80f37e3e6b (diff)
better operator overload
Diffstat (limited to 'code')
-rw-r--r--code/main.felan29
1 files changed, 12 insertions, 17 deletions
diff --git a/code/main.felan b/code/main.felan
index d629a26..98aa762 100644
--- a/code/main.felan
+++ b/code/main.felan
@@ -1,16 +1,6 @@
-@import("lib/operator.felan");
+@import("basic.felan");
-/*
-print :: (value:anytype) -> void {
- if comptime @type_of(value) == u8 {
- @putc(value);
- }else{
- @putc('h');
- }
-};
-*/
-
-print :: (value:*anytype)->void{
+print :: (value:**anytype)->void{
if comptime @type_of(value.*) == u8 {
@putc(value.*);
}else{
@@ -18,11 +8,16 @@ print :: (value:*anytype)->void{
}
};
+__sum__ :: (left:*anytype,right:i64) -> (@type_of(left)) {
+ return @add(left,right);
+};
+
main :: ()->void{
- a := 'a';
- b := 123;
- print(&a);
- print(&b);
- // print(123);
+ arr :[10]i64= undefined;
+ arr[0] = 2;
+ arr[1] = 3;
+ p := &arr[0];
+ p += 1;
+ print(p.*);
};