lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

... may be an expression, but the question is: what does # do when
applied to multiple values? It can discard all of them except the
first, or it can count them.

Given the second interpretation, #{whatever} and #"whatever" work as
now, but #... returns the count of arguments;

And what if ... *is* only a single item?

Also, there will be situations where you can get very unexpected results:

    #string.gsub(a, b ,c)  -- this is always 2!

In this case you must carefully write:

    #(string.gsub(a, b, c))