2006-11-15:


Added table object constructor : you can set the values of the object params by passing arguments to the object constructor

Example:

	-------tolua-table-constructor.hxx----------
	class TCLASS{
	....
	  struct TPARAM{
	    int value;
	    string name;
	  };
	....
	  TPARAM param;
	  int value;
	  string name;
	....
	  TCLASS();
	....
	};

	-------tolua-table-constructor.lua----------
	local t=TCLASS{
	   name="newopt",
	   param={
	      name="newsubopt",
	      value
	   },
	   value=0.12
	}
	

2006-11-14:


Added proxy stack parameter pass technology. Proxy stack consists of enumerated levels from 1 to N. Each level holds several named params. If you specify positive value N during stack level call, this means that you call N th element from the beginning of the stack, negative value means that you call nth element from the end of the stack. Empty stack has zero level count; toluaxx API functions for parameters stack handling:

	int  tolua_proxytop(lua_State* L);
	/* return the current top of the stack */
	
	int  tolua_proxypush(lua_State* L);
	/* creates empty stack level */
	
	int  tolua_proxypop(lua_State* L);
	/* erases top level of the stack */
	
	void tolua_proxylevel(lua_State* L, int level);
	/* extracts queried level as a table */
						
	void tolua_getproxy(lua_State* L, int level);
	/* returns the value of queried stack level parameter */
	/* (similar to lua_gettable()) */
	
	void tolua_setproxy(lua_State* L, int level);
	/* sets the value of the stack level */
	/* (similar lua_settable()) */

toluaxx proxy functions, available from lua:

	local top = tolua.proxy.top()
	-- returns stack top
	-- top will be equal to current stack top

	local level = tolua.proxy.level(<level>)
	-- returns stack level <level> (top level by default)
	-- level will content a table of selected level params

	local state = tolua.proxy.push()
	-- creates new stack level (on top)
	-- state will be set to true if operation successful
	-- false - in case of stack overflow

	local state = tolua.proxy.pop()
	-- pop top level of the stack
	-- state - true if ok
	-- false - false if stack is empty

	local val = tolua.proxy.get(key<,level>)
	-- extracts the parameter key from the <level> level of the stack (top by default)
	-- val will be set to the parameter value, nil if no such parameter exists 

	tolua.proxy.set(key,value<,level>)
	-- assigns value to the parameter key from the level stack level (top by default)

toluaxx/src/test/tproxy.* contain examples for this functions

2006-11-13:


Corrected export of arrays which are situated inside namespaces

2006-11-10:


Added tolua_getindex { } and tolua_setindex { } directives. First one serves for index extracting, another - for setting index. These functions allow `.{get,set}{i,s}` methods specification.

Example:

	-------tolua-get-set-index.hxx-------
	class TOBJECT{
	....
	};
	class TGROUP: public TOBJECT{
	  /**tolua_getindex {**/
	  TOBJECT* get(string);
	  /**}**/
	  /**tolua_setindex {**/
	  void set(string,TOBJECT*);
	  /**}**/
	....
	};
		
	-------tolua-index-test.lua----------
	local g1=TGROUP()
	g1.o1=TOBJECT()  --- set method call
	local o1=g1.o1    --- get method call

2006-10-24:


Moved userdata added to the objects through .set{i,s} methods to peer to disable garbage collecting during runtime on them.

Example:

	
	local g1=GRP()
	local o1=OBJ()
	
	g1.o1=o1
	collectgarbage"collect" --- object o1 will not be colected,
				--- because the link still exists
				--- in the local scope
	
	g1.o2=OBJ()
	collectgarbage"collect" --- object g1.o2 will be collected
				--- because it was created in lua and there is no link on it

--- the (2006-10-24) fix solves this problem by moving the link on the object to the
--- peer g1

2006-10-23:


Special comment `/**` bind code `**/` <bind code> is now invisible to C/C++ compiler, but toluaxx preprocessor still parses it. Now all the export code can be placed inside the header files

2006-10-04:


Added the default specificator "asnil". The variable would be interpreted as nil if it is equal to the default value.

Example

	------asnil-test.hxx----------------
	class TCLASS{
	       ....
	 public:
	  string menu;
	  void item(string&name){
	    int p,s;
	    if((p=menu.find(name+":"))<menu.length()){
	      p=p+name.length()+1;
	      s=menu.find(" ",p);
	      name=menu.substr(p,s-p);
	    }else name="";
	  }
	};
	------asnil-test.pxx----------------
	class TCLASS{
	       ....
	 public:
	  string menu;
	  void item(string&name="" asnil);
	};
	------asnil-test.lua----------------
	require"asnil-test"
	local t=TCLASS()
	t.menu="first:call second:of third:cthulhu"
	assert(t:item("first")=="call")
	assert(t:item("second")=="of")
	assert(t:item("third")=="cthulhu")
	assert(t:item("fourth"==nil)
This is useful in iterators see src/tests/*index.*

2006-10-03:


Added tolua_callmethod(class_name,method_name,arguments, num_of_returns,returns) macro. It allows to call class method (which can be represented by lua function)

Example:

	------call-method-test.hxx----------
	class TCLASS{
	 public:
	  float delta;
	  float time;
	       ....
	  void make(float period){
	    tolua_callmethod(TCLASS,handler,
	      tolua_pushnumber(L,time);
	      tolua_pushnumber(L,period),
	      1,
	      time=tolua_tonumber(L,1)
	    );
	  }
	};
	------call-method-test.lua----------
	require"call-method-test"
	local t=TCLASS()
	function t:handler(time,period)
	   time=time+period
	   self.delta=self.delta+period
	   return time
	end

	t:make(10)
	

2006-09-02:


Corrected the ${i,l,h,c}file"" bug. Now these methods search files first in preprocessor directory and then in the directory where the preprocessed file is situated.

2006-09-29:


Now indexing operator [] works for strings. The `__{index,newindex}\\.{get,set}s` method is used.

Corrected bug with declaraing variables inside namespaces (Nested namespaces are not supported)

2006-09-28:


Added `()` (__call\\.callself) - operator for calling self. (useful for iterators)

2006-09-27:


Added unary operators

  • `-` (__unm\\.unm) - unary minus ('-' as C++ equivalent)
  • `#` (__len\\.len) - length operator ('~' as C++ equivalent)

2006-09-25:


Added lua5.1 operators :

  • `^` (__pow\\.pow) - power operation ('^' as C++ equivalent)
  • `..` (__concat\\.concat) - concatenation ('|' as C++ equivalent)

toluaxx 2006