lua-users home
lua-l archive

Re: paving cowpaths with libraries (was Re: Upstream is not the last word (was Re: [ANN] Lua 5.1.5 (rc1) now available))

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


On Wed, Feb 15, 2012 at 12:40 PM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> Personally I prefer a multiset aka histogram: instead of `s[v]=true`,
>    s[v] = (s[v] or 0) + 1
And with
s = setmetatable({},{__index = function(t,k) return 0 end})
you can reach notational nirvana
s[v] = s[v] + 1
steve d.

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