From e8576dbeb5ba0cfa6b9aaae41f3af52b17cfa54a Mon Sep 17 00:00:00 2001 From: Phil Hagelberg Date: Mon, 28 Jun 2021 08:33:03 -0700 Subject: [PATCH] A little extra about ... being weird and not a first-class value. --- lua-primer.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lua-primer.md b/lua-primer.md index 82409959..567208ef 100644 --- a/lua-primer.md +++ b/lua-primer.md @@ -162,7 +162,14 @@ The `...` values also work at the top level of a file. They are usually used to capture command-line arguments for files run directly from the command line, but they can also pass on values from a `dofile` call or tell you the name of the current module in a file -that's loaded from `require`. +that's loaded from `require`. Note that since `...` represents +multiple values it is common to put it in a table to store it, unless +the number of values is known ahead of time: + +```fennel +(local (first-arg second-arg) ...) +(local all-args [...]) +``` ## Lua loading