[Pedantic fun] Rename things

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Pedantic fun] Rename things

Soni "They/Them" L.
tostring should be named _TOSTRING, package.preload should be named package._PRELOAD, package.loaded -> package._LOADED, etc...

Wait uhh... maybe not the package tables as Lua doesn't use the package table to look them up... but definetly _TOSTRING as print() uses it.

--

For real tho, what's the rationale behind not calling it _TOSTRING? (also for metamethods - why not _EQ, _NE, _INDEX, _NEWINDEX etc?)
-- 
Disclaimer: these emails are public and can be accessed from <TODO: get a non-DHCP IP and put it here>. If you do not agree with this, DO NOT REPLY.
Reply | Threaded
Open this post in threaded view
|

Re: [Pedantic fun] Rename things

Ryan
At this point, it's compatibility.  All code that has ever depended on tostring will have to be rewritten.  What's the rationale behind changing it to be honest?

On Wed, Dec 10, 2014 at 7:01 PM, Thiago L. <[hidden email]> wrote:
tostring should be named _TOSTRING, package.preload should be named package._PRELOAD, package.loaded -> package._LOADED, etc...

Wait uhh... maybe not the package tables as Lua doesn't use the package table to look them up... but definetly _TOSTRING as print() uses it.

--

For real tho, what's the rationale behind not calling it _TOSTRING? (also for metamethods - why not _EQ, _NE, _INDEX, _NEWINDEX etc?)
-- 
Disclaimer: these emails are public and can be accessed from <TODO: get a non-DHCP IP and put it here>. If you do not agree with this, DO NOT REPLY.