lua-users home
lua-l archive

select("#", ...) idiom

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


I dislike the suddenly-popular select( "#", ... ) idiom because it is 
uninformative (no selection is made), complicates select with unrelated 
behavior, and misappropriates the # symbol. Of everything 5.1-related on 
the Lua list, this is the ONLY item I've had to look up in the docs to 
grok! Could this behavior be externalized? I can only imagine that any 
reasonable coder would define
function count(...)	return select("#", ...)	end
or such with a useful name (slots, args, last, etc), if this remains in 
the standard library.
Lua has many beautiful idioms, please don't spread this ugly one!
-Lucas

AltStyle によって変換されたページ (->オリジナル) /