This commit is contained in:
Krzosa Karol
2022-09-28 17:15:22 +02:00
parent 95400a0929
commit 681b3c1f95
8 changed files with 84 additions and 56 deletions

View File

@@ -50,6 +50,20 @@ Vec3_Add :: (a: Vec3, b: Vec3): Vec3 ;; return Vec3{a.x+b.x, a.y+b.y, a.z+b.
Vec3_Div :: (a: Vec3, b: Vec3): Vec3 ;; return Vec3{a.x/b.x, a.y/b.y, a.z/b.z}
Vec3_Sub :: (a: Vec3, b: Vec3): Vec3 ;; return Vec3{a.x-b.x, a.y-b.y, a.z-b.z}
/*
@todo: Add function overloading
Current plan:
* allow insert_into_scope to insert multiple lambdas
* change resolve_name and search_for_decl to something
that can seek multiple lambda declarations
resolve them and return a match to hash or type
* change the order of lambda call resolution, probably would have to
hash the arguments first to match the lambda call
*/
// Add :: (a: Vec3, b: Vec3): Vec3 ;; return Vec3{a.x+b.x, a.y+b.y, a.z+b.z}
// Add :: (a: Vec2, b: Vec2): Vec2 ;; return Vec2{a.x+b.x, a.y+b.y}
F32_Clamp :: (min: F32, value: F32, max: F32): F32
if value > max;; return max
if value < min;; return min