From 13415a97d3f20fadc8827d8fb4eee7b23767c67b Mon Sep 17 00:00:00 2001 From: XeroOl Date: Mon, 2 Jun 2025 22:41:53 -0500 Subject: [PATCH] minor edits to the lint descriptions I hope these edits make the lint descriptions a bit clearer, but I'm not sure --- docs/lints.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/docs/lints.md b/docs/lints.md index 31190db..fe5cdb6 100644 --- a/docs/lints.md +++ b/docs/lints.md @@ -201,8 +201,8 @@ for clarity. Instead, use: ```fnl -(local x 10) -(print x) +(let [x 10] + (print x)) ``` # op-with-no-arguments @@ -296,15 +296,12 @@ multivals instead of discarding them. Instead, use: ```fnl -;; Either put the multival at the end: +;; Try putting the multival at the end: (print 4 (values 1 2 3)) -;; Change your logic to explicitly capture the values +;; Try writing the logic out manually instead of using multival (let [(a b c) (values 1 2 3)] (print a b c 4) - -;; Use `do` to make it clear that you intend to ignore the extra values -(print (do 2 3 1) 4)) ``` ## Limitations @@ -315,4 +312,8 @@ most of the time, only the first one is what's wanted. This lint specifically flags discarding multivals from `values` and `unpack`, instead of flagging all discards, because these forms indicate that the user -*intends* for something to happen with multivals. \ No newline at end of file +*intends* for something to happen with multivals. + +## Note +You find more information about Lua's multivals in [Benaiah's excellent post explaining Lua's multivals](https://benaiah.me/posts/everything-you-didnt-want-to-know-about-lua-multivals), +or by searching the word "adjust" in the [Lua Manual](https://www.lua.org/manual/5.4/manual.html#3.4.12). \ No newline at end of file