Re: Question about SETFIELD nil emission in table constructor codegen

Luiz Henrique de Figueiredo <[email protected]>
Newsgroups gmane.comp.lang.lua.general
Message-ID <CABt16q=e91C3UbXMPMOe6mbKiCTzK56tUaA9FKfFqNC-EgK=ow@mail.gmail.com>
> Concerning literal tables, I've always asked myself why the compiler does not build table literals with only constant members at compile time and stores them in a constant pool, as it already does for strings and scalars.

Consider this code:

function f() return {1,2,3} end
A=f()
B=f()

With your proposed scheme, A and B would get the same table, not two
different tables with the same contents.
If the runtime needed to create copies of table literals then the
executed code would be much the same.

-- 
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/CABt16q%3De91C3UbXMPMOe6mbKiCTzK56tUaA9FKfFqNC-EgK%3Dow%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.