Prefixes in lua source code lua_, luai_, etc.

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

Prefixes in lua source code lua_, luai_, etc.

John W
I feel like I read some explanation for this, but can't find it any more.
What are the meanings of the various prefixes seen in the Lua source code?

eg: lua_, luai_, l_

Are these documented somewhere?
I just want to make sure my patches to be copacetic with the naming conventions.

Thanks
-John
Reply | Threaded
Open this post in threaded view
|

Re: Prefixes in lua source code lua_, luai_, etc.

Roberto Ierusalimschy
> I feel like I read some explanation for this, but can't find it any more.
> What are the meanings of the various prefixes seen in the Lua source code?
>
> eg: lua_, luai_, l_
>
> Are these documented somewhere?

This is for internal use, and there is no documentation. Usually, 'lua_'
is for public names (exported through the official API), 'luai_' are for
names that should not be used by external code, but need to be visible
there, and 'l_' is for internal names. ('l_' is usually used only in
simple/small names, which could collide with some name being imported in
a header file.)  (Note the "Usually"!)

-- Roberto