lua-users home
lua-l archive

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


On Monday, October 27, 2014 09:55:38 AM Dirk Laurie wrote:
> You could do
> 
> wanted = select(i,struct.unpack(fmt,s))
> 
> or keep the desired format options as a list, then
> 
> offset = #struct.pack(table.concat(options,1,i-1))
> nwanted = #offset+1 -- do this once and for all
> wanted = struct.unpack(options[i],s,nwanted)

A few months ago I experimented with allowing `nil` on the left side of 
assignment to discard individual results.

http://lua-users.org/lists/lua-l/2014-06/msg00249.html

Should still apply to the beta. At least, I haven't had to deal with any 
conflicts when merging the releases.

-- 
tom <telliamed@whoopdedo.org>