From 8e72532ed1ed857a5d307bc495902b7267297d79 Mon Sep 17 00:00:00 2001 From: Judah Caruso Date: Tue, 5 Dec 2023 11:00:51 -0700 Subject: [PATCH] other operators should be macros as well --- core/operations.onyx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core/operations.onyx b/core/operations.onyx index 6e203f65..0d12172d 100644 --- a/core/operations.onyx +++ b/core/operations.onyx @@ -13,11 +13,10 @@ package builtin // // Allows for basic array programming support -#operator + (l, r: [$N]$T) => __array_math_op(l, r, [a, b](a + b)); -#operator - (l, r: [$N]$T) => __array_math_op(l, r, [a, b](a - b)); -#operator * (l, r: [$N]$T) => __array_math_op(l, r, [a, b](a * b)); -#operator / (l, r: [$N]$T) => __array_math_op(l, r, [a, b](a / b)); - +#operator + macro (l, r: [$N]$T) => __array_math_op(l, r, [a, b](a + b)); +#operator - macro (l, r: [$N]$T) => __array_math_op(l, r, [a, b](a - b)); +#operator * macro (l, r: [$N]$T) => __array_math_op(l, r, [a, b](a * b)); +#operator / macro (l, r: [$N]$T) => __array_math_op(l, r, [a, b](a / b)); #operator == macro (l, r: [$N]$T) => core.intrinsics.wasm.memory_equal(cast(rawptr)l, cast(rawptr)r, N * sizeof T); #operator != macro (l, r: [$N]$T) => !(l == r); -- 2.25.1