+ isSymbol = (function ()
+ local symbols = [=[~`!@#$%^&*()_-+=|\{[}]:;"'<,>?/]=]
+ return function(char)
+ for ix = 1, string.len(symbols), 1 do
+ if char == string.sub(symbols, ix, ix) then
+ return true
+ end
+ end
+ return false
+ end
+ end)()
+
+ process = function(input)
+ if type(input) == "string" then
+ input = io.open(input)
+ end
+ local charset = {}
+ for line in input:lines() do
+ for ix = 1, string.len(line), 1 do
+ charset[string.sub(line, ix, ix)] = true
+ end
+ end
+ local s = ""
+ for k, v in pairs(charset) do
+ s = s .. k
+ end
+ print(s)
+ end
+
+ main = function()
+ local ix
+ ix = 1
+ while arg[ix] do
+ process(arg[ix])
+ ix = ix + 1
+ end
+ end
+
+ main()