lua-users home
lua-l archive

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


On 2/21/08, Mike Pall <mikelu-0802@mike.de> wrote:
> local t = setmetatable({}, { __index = function() return 0 end })
>  for c in string.gmatch(io.read("*a"), ".") do t[c] = t[c] + 1 end
>  table.foreach(t, print)

very neat!

now, which way is the fastest?


-- 
Javier