Replaces non-simple values in a list with nil.
All simple values (strings, numbers, and booleans) are passed from the input list to the output list unchanged. Non-simple values (tables, functions, threads, and userdata) are replaced by nil in the output list.
See also Utility functions.
Signature:
...
=
scrub(...)
Arguments:
...
- A list of values (list
)
Returns:
...
- The list of input values, with all non-simple values replaced by nil (list
)
Examples:
scrub("a", print, 1, {1,2,3}, math.pi) -- returns "a", nil, 1, nil, 3.1415926535898