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.

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

tom <>