Re: Function to force table to shrink?

Rett Berg <[email protected]>
Newsgroups gmane.comp.lang.lua.general
Message-ID <CALW7ahx5jy=5G_v60ZuA0S7EWPSJPb9NvXEDrdBgZG9MOcNCtw@mail.gmail.com>
Yes, but I want other references to see an empty table

For example, if there are a bunch of workers (coroutines) putting stuff to
do into a table. After all the stuff is done I could do table.clear

ITT I literally move all values to a proxy, then clear the table.

On Mon, Feb 2, 2026, 10:51 PM bil til <[email protected]> wrote:

> > It would still be nice IMO to have a table.clear() which just
>
> sorry for a stupid question, I did not really understand all the
> details of this discussion.
>
> But if for a table t you just write t=nil, won't this also delete the
> table?
>
> (so it would do the same as what you want to do by t.clear()?
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "lua-l" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/lua-l/vAcAMy7GFJY/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion visit
> https://groups.google.com/d/msgid/lua-l/CAOnDXmHrPmsSRsq6MtnQkOp7oV%2Batt_7G8oeFGnLtrpbGWTVBQ%40mail.gmail.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups "lua-l" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/lua-l/CALW7ahx5jy%3D5G_v60ZuA0S7EWPSJPb9NvXEDrdBgZG9MOcNCtw%40mail.gmail.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.