lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Tue, May 24, 2011 at 10:43:13AM +0200, Dirk Laurie wrote:
> Sorry for betraying my newbie-ness, this question was probably asked
> fifteen years ago.
> 
> In the Lua API, Lua strings are mapped to C "char*".  Is this just a 
> historical accident or a closely reasoned decision, such as that the 
> convenience of the test "if (c<0)" to detect non-ASCII is more 
> important than the inconvenience of occasional casts from "char*" to 
> "unsigned char*"?

Lua's written in C, and C strings are char *, not unsigned char * :)
Also, on some platforms, 'char' is unsigned.

B.