lua-users home
lua-l archive

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

Has there been any discussion of changing the Lua float type from float
to double? I did this on my own so that you could go from float type to int
type without losing data.

-----Original Message-----
From:	Waldemar Celes []
Sent:	Tuesday, March 18, 1997 8:00 AM
Subject:	Lua API for C++ code

For those who are accessing Lua from C++ code,
this may be of interest.

I have implemented a C++ API to access and manipulate Lua values.
It consists of a header file (lua++.h) that defines a few classes
that naturally bind Lua objects to C++ type and vice-versa. 

For instance, if we have the following Lua code:

myTable = {name = "lua++"}

It is valid to write a C++ code like this one:

 LuaObject t = Lua:getglobal("myTable");  // access the table object
 LuaObject f = Lua:getglobal("print");    // access the pre-defined function 
 f(t["name"]);       // call Lua function

which will output the string "lua++".

Also, if we have a Lua function:

function myFunc (a,b)

We can call it from C++ code doing:

 LuaObject f = Lua:getglobal("myFunc");

It is still a beta version, but if you want to try it
and help me to improve it, the code and a naive documentation
can be reached at:


Waldemar Celes
Program of Computer Graphics
Cornell University
580 Engineering Theory Center Building
Ithaca, NY -- 14853
home page: