From 02b16980fec9027b85218723176b3f56529703ff Mon Sep 17 00:00:00 2001 From: Dibri Nsofor Date: Wed, 17 Jul 2024 17:22:28 -0700 Subject: [PATCH] minor improvements Signed-off-by: Dibri Nsofor --- docs/function-inlining.md | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/docs/function-inlining.md b/docs/function-inlining.md index 5df12e7..1b38fb9 100644 --- a/docs/function-inlining.md +++ b/docs/function-inlining.md @@ -98,19 +98,6 @@ end ``` In this example, we declare `Vec3` with an inlined `__add` (`+`) operator overload. To make this inlining work, we would need to do one of two things, (1) confirm the `rhs` and `lhs` share the same shape (i.e, they both have`x`, `y` and `z`) or (2) ensure the `rhs` has a similar operator overload. Due to dynamic dispatch, we cannot make either guarantee making this case unsuitable for overloads. - -4. Higher Order Functions -```luau -@inline -local function add(x, y) - return x + y -end - -local function accumulate(acc, i, lst, f) - return if i > #lst then acc else accumulate(f(acc, lst[i]), i + 1, lst, f) -end -``` - ## Design None (yet).