From 6b2cbbbc009c5db25d9ff797e75b09aa14e54918 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Mon, 27 Feb 2023 12:17:16 -0800 Subject: [PATCH] docs: Add deprecation notice to getn/foreach/foreachi --- docs/_pages/library.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/_pages/library.md b/docs/_pages/library.md index 2939f930..877f1883 100644 --- a/docs/_pages/library.md +++ b/docs/_pages/library.md @@ -374,19 +374,19 @@ Concatenate all elements of `a` with indices in range `[f..t]` together, using ` function table.foreach(t: { [K]: V }, f: (K, V) -> R?): R? ``` -Iterates over all elements of the table in unspecified order; for each key-value pair, calls `f` and returns the result of `f` if it's non-nil. If all invocations of `f` returned `nil`, returns no values. +Iterates over all elements of the table in unspecified order; for each key-value pair, calls `f` and returns the result of `f` if it's non-nil. If all invocations of `f` returned `nil`, returns no values. This function has been deprecated and is not recommended for use in new code. ``` function table.foreachi(t: {V}, f: (number, V) -> R?): R? ``` -Iterates over numeric keys of the table in `[1..#t]` range in order; for each key-value pair, calls `f` and returns the result of `f` if it's non-nil. If all invocations of `f` returned `nil`, returns no values. +Iterates over numeric keys of the table in `[1..#t]` range in order; for each key-value pair, calls `f` and returns the result of `f` if it's non-nil. If all invocations of `f` returned `nil`, returns no values. This function has been deprecated and is not recommended for use in new code. ``` function table.getn(t: {V}): number ``` -Returns the length of table `t` (equivalent to `#t`). +Returns the length of table `t` (equivalent to `#t`). This function has been deprecated and is not recommended for use in new code. ``` function table.maxn(t: {V}): number