From e113d0c462811518e0b45159ec97503e878b329c Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 22 Jan 2023 19:48:04 -0500 Subject: Overload vec3/vec4 constructors. --- chickadee/graphics/seagull.scm | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/chickadee/graphics/seagull.scm b/chickadee/graphics/seagull.scm index 9403f37..023223b 100644 --- a/chickadee/graphics/seagull.scm +++ b/chickadee/graphics/seagull.scm @@ -760,12 +760,28 @@ (list vec2-type)))) (define make-vec3-type - (list (function-type (list float-type float-type float-type) - (list vec3-type)))) + (list (overload-type + (function-type (list float-type float-type float-type) + (list vec3-type)) + (function-type (list vec2-type float-type) + (list vec3-type)) + (function-type (list float-type vec2-type) + (list vec3-type))))) (define make-vec4-type - (list (function-type (list float-type float-type float-type float-type) - (list vec4-type)))) + (list (overload-type + (function-type (list float-type float-type float-type float-type) + (list vec4-type)) + (function-type (list vec2-type float-type float-type) + (list vec4-type)) + (function-type (list float-type vec2-type float-type) + (list vec4-type)) + (function-type (list float-type float-type vec2-type) + (list vec4-type)) + (function-type (list vec3-type float-type) + (list vec4-type)) + (function-type (list float-type vec3-type) + (list vec4-type))))) (define (top-level-type-env) `((+ . ,add/sub-type) -- cgit v1.2.3