just create
once a table, either as local or as global (but then use a unique table name). register the "WHO_LIST_UPDATE" event and then compare the returned /who names with the names in your table and save all /who names into your table for the next /who command.
Code:
local myUniqueTableNames = {}
local f = CreateFrame("Frame")
f:SetScript("WHO_LIST_UPDATE", function()
local _, n = GetNumWhoResults()
for i = 1, n do
-- comparing stuff (GetWhoInfo(index)) etc.
end
end
this should suffice.