Index: trunk/nv/lua/lua_state.hh
===================================================================
--- trunk/nv/lua/lua_state.hh	(revision 78)
+++ trunk/nv/lua/lua_state.hh	(revision 79)
@@ -19,10 +19,10 @@
 	namespace lua
 	{
-		const int ref_none = -2;
-		const int ref_nil  = -1;
+		const int ref_none  = -2;
+		const int ref_nil   = -1;
+		const int ret_multi = -1;
 
 		class state;
 		typedef int reference;
-		static const int null_reference = -2;
 
 		class stack_guard
@@ -63,8 +63,5 @@
 			state( bool load_libs = false );
 			state( lua_State* state );
-			int load_string( const std::string& code, const std::string& name );
-			int load_stream( std::istream& stream, const std::string& name );
-			int load_file( const std::string& filename );
-			bool do_string( const std::string& code, const std::string& name );
+			bool do_string( const std::string& code, const std::string& name, int rvalues = 0 );
 			bool do_stream( std::istream& stream, const std::string& name );
 			bool do_file( const std::string& filename );
@@ -76,5 +73,8 @@
 			~state();
 		private:
-			int do_current( const std::string& name );
+			int load_string( const std::string& code, const std::string& name );
+			int load_stream( std::istream& stream, const std::string& name );
+			int load_file( const std::string& filename );
+			int do_current( const std::string& name, int rvalues = 0 );
 			bool push( const std::string& path, bool global = true );
 			void deep_pointer_copy( int index, void* obj );
Index: trunk/src/lua/lua_state.cc
===================================================================
--- trunk/src/lua/lua_state.cc	(revision 78)
+++ trunk/src/lua/lua_state.cc	(revision 79)
@@ -76,5 +76,5 @@
 }
 
-bool lua::state::do_string( const std::string& code, const std::string& name )
+bool lua::state::do_string( const std::string& code, const std::string& name, int rvalues )
 {
 	lua::stack_guard( this );
@@ -85,5 +85,5 @@
 		return false;
 	}
-	return do_current( name ) == 0;
+	return do_current( name, rvalues ) == 0;
 }
 
@@ -112,7 +112,7 @@
 }
 
-int lua::state::do_current( const std::string& name )
-{
-	int result = lua_pcall(L, 0, 0, 0);
+int lua::state::do_current( const std::string& name, int rvalues )
+{
+	int result = lua_pcall(L, 0, rvalues, 0);
 	if (result) 
 	{
Index: trunk/tests/lualib_test/lualib_test.cc
===================================================================
--- trunk/tests/lualib_test/lualib_test.cc	(revision 78)
+++ trunk/tests/lualib_test/lualib_test.cc	(revision 79)
@@ -53,7 +53,6 @@
 			std::cout << "> " << input << std::endl;
 
-			int code = luaL_loadstring( state.get_raw(), input.c_str() );
-			if (code == 0) code = lua_pcall( state.get_raw(), 0, LUA_MULTRET, 0);
-			if (code != 0)
+			bool result = state.do_string( input, "", nv::lua::ret_multi );
+			if ( !result )
 			{
 				std::string error = lua_tostring( state.get_raw(), -1 );
