Damn I didn't even know this language could do that, I guess an issue

with namespacing fixed itself
This commit is contained in:
Krzosa Karol
2022-09-30 16:36:55 +02:00
parent 233115cf2c
commit a6f6147df3
11 changed files with 69 additions and 61 deletions

View File

@@ -3,7 +3,11 @@ Vec3 :: struct;; x: F32; y: F32; z: F32
// We can define operator overloads for arbitrary types
// these are just regular lambdas/functions
"+" :: (a: Vec3, b: Vec3): Vec3 ;; return {a.x+b.x, a.y+b.y, a.z+b.z}
"+" :: (a: Vec3, b: Vec3): Vec3
return {a.x+b.x, a.y+b.y, a.z+b.z}
// We can make a one liner out of these using ';;' operator
// which functions as a new line with indent
"-" :: (a: Vec3, b: Vec3): Vec3 ;; return {a.x-b.x, a.y-b.y, a.z-b.z}
"-" :: (a: Vec3): Vec3 ;; return {-a.x, -a.y, -a.z}