Closed Ambrevar closed 7 years ago
I would agree that the distinction may be useful. I wonder what the original intention here is - that the patch is to ensure that Lua code does consider proxies to be tables?
Second thoughts...
Further questions:
table<go/map>
or table<map>
?table<go/map>
, table<luar/map>
?table<go.map>
, table<luar/map>
?I would go for simplicity and opt for table<map>
.
Simplicity feels like a good thing here. Either it's a proxy or it's already a Lua table.
To point of having a prefix is for Lua program to make the distinction between their host platforms (original Lua, luajit, luar, golua, etc.). Not sure there is any convention there, and not sure that would ever be needed either.
Such scripts can query their own environment,_VERSION
etc.
But both golua and luar keep _VERSION
unchanged. Which is probably the right thing to do...
Any thought on that?
Changing the type
function will break backward compatibility though, so I suggest to move this together with the API change #32.
I've pushed the changes to the proxytype
branch. Let's wait for what will get decided regarding the API change.
The change has been merged in the v2 branch.
See: https://github.com/bitwalker/luar/commit/9747fcd0e1bcc9fbb24e6221f5577b2fbf31b3ad This allows for
type()
to return something more interesting about proxies. The aforementioned commit returnstable
. I like the idea of making the distinction between real Lua tables and proxy tables. What about returninguserdata(map)
proxy(map)
.goluadata(map)
.luardata(map)
.Comments?