ソースを参照

Naming conventions is a funny thing

Ole Krüger 10 年 前
コミット
1a8b55fe15
共有8 個のファイルを変更した145 個の追加145 個の削除を含む
  1. 6 6
      examples/functions.cpp
  2. 7 7
      examples/stack.cpp
  3. 8 8
      examples/types.cpp
  4. 6 6
      examples/usertypes.cpp
  5. 18 18
      lib/luwra/functions.hpp
  6. 17 17
      lib/luwra/stack.hpp
  7. 38 38
      lib/luwra/types.hpp
  8. 45 45
      lib/luwra/usertypes.hpp

+ 6 - 6
examples/functions.cpp

@@ -25,18 +25,18 @@ int main() {
 	luaL_openlibs(state);
 
 	// Register 'my_function_1'
-	auto wrapped_1 = WrapFunction<void(float, const char*), my_function_1>;
-	Push(state, wrapped_1);
+	auto wrapped_1 = wrap_function<void(float, const char*), my_function_1>;
+	push(state, wrapped_1);
 	lua_setglobal(state, "my_function_1");
 
 	// Register 'my_function_2'
-	auto wrapped_2 = WrapFunction<std::string(), my_function_2>;
-	Push(state, wrapped_2);
+	auto wrapped_2 = wrap_function<std::string(), my_function_2>;
+	push(state, wrapped_2);
 	lua_setglobal(state, "my_function_2");
 
 	// Register 'my_function_3'
-	auto wrapped_3 = WrapFunction<int(int, int), my_function_3>;
-	Push(state, wrapped_3);
+	auto wrapped_3 = wrap_function<int(int, int), my_function_3>;
+	push(state, wrapped_3);
 	lua_setglobal(state, "my_function_3");
 
 	// Invoke the attached script

+ 7 - 7
examples/stack.cpp

@@ -15,18 +15,18 @@ int main() {
 	luaL_openlibs(state);
 
 	// Build stack
-	Push(state, 13);
-	Push(state, 37);
-	Push(state, 42.2);
+	push(state, 13);
+	push(state, 37);
+	push(state, 42.2);
 
 	// Each value can be retrieved individually.
-	std::cout << "a = " << Value<int>::Read(state, 1) << std::endl;
-	std::cout << "b = " << Value<int>::Read(state, 2) << std::endl;
-	std::cout << "c = " << Value<double>::Read(state, 3) << std::endl;
+	std::cout << "a = " << Value<int>::read(state, 1) << std::endl;
+	std::cout << "b = " << Value<int>::read(state, 2) << std::endl;
+	std::cout << "c = " << Value<double>::read(state, 3) << std::endl;
 
 	// ... which is a little cumbersome. Instead we might apply a fitting function to our stack.
 	std::cout << "(a + b) * c = "
-	          << Apply(state, sum3) // Equivalent to Apply(state, 1, sum3) or Apply(state, -3, sum3)
+	          << apply(state, sum3) // Equivalent to apply(state, 1, sum3) or apply(state, -3, sum3)
 	          << std::endl;
 
 	lua_close(state);

+ 8 - 8
examples/types.cpp

@@ -12,8 +12,8 @@ struct Value<char> {
 	 * Retrieve the value at position `n`.
 	 */
 	static inline
-	char Read(State* state, int n) {
-		auto str = Value<std::string>::Read(state, n);
+	char read(State* state, int n) {
+		auto str = Value<std::string>::read(state, n);
 
 		if (str.length() < 1) {
 			luaL_argerror(state, n, "Given empty string instead of character");
@@ -23,10 +23,10 @@ struct Value<char> {
 	}
 
 	/**
-	 * Push the value onto the stack.
+	 * push the value onto the stack.
 	 */
 	static inline
-	int Push(State* state, char val) {
+	int push(State* state, char val) {
 		if (val == 0)
 			return 0;
 
@@ -46,11 +46,11 @@ int main() {
 	luaL_openlibs(state);
 
 	// Build stack
-	Push(state, 'H');
-	Push(state, 'i');
+	push(state, 'H');
+	push(state, 'i');
 
-	// Apply function to stack values
-	Apply(state, read_chars);
+	// apply function to stack values
+	apply(state, read_chars);
 
 	lua_close(state);
 	return 0;

+ 6 - 6
examples/usertypes.cpp

@@ -35,24 +35,24 @@ int main() {
 	// Register our user type.
 	// This function also registers a garbage-collector hook and a string representation function.
 	// Both can be overwritten using the third parameter, which lets you add custom meta methods.
-	RegisterUserType<Point>(
+	register_user_type<Point>(
 		state,
 		// Methods which shall be availabe in the Lua user data, need to be declared here
 		{
-			{"scale", WrapMethod<Point, void(double), &Point::scale>},
-			{"x",     WrapProperty<Point, double, &Point::x>},
-			{"y",     WrapProperty<Point, double, &Point::y>}
+			{"scale", wrap_method<Point, void(double), &Point::scale>},
+			{"x",     wrap_property<Point, double, &Point::x>},
+			{"y",     wrap_property<Point, double, &Point::y>}
 		},
 		// Meta methods may be registered aswell
 		{
-			{"__tostring", WrapMethod<Point, std::string(), &Point::toString>}
+			{"__tostring", wrap_method<Point, std::string(), &Point::toString>}
 		}
 	);
 
 	// What's left, is registering a constructor for our type.
 	// We have to specify which parameters our constructor takes, because there might be more than
 	// one constructor to deal with.
-	Push(state, WrapConstructor<Point, double, double>);
+	push(state, wrap_constructor<Point, double, double>);
 	lua_setglobal(state, "Point");
 
 	// Invoke the attached script

+ 18 - 18
lib/luwra/functions.hpp

@@ -24,37 +24,37 @@ namespace internal {
 
 	template <>
 	struct FunctionWrapper<void()> {
-		template <void(*FunctionPointer)()> static
-		int Invoke(State*) {
-			FunctionPointer();
+		template <void(*function_pointer)()> static
+		int invoke(State*) {
+			function_pointer();
 			return 0;
 		}
 	};
 
 	template <typename R>
 	struct FunctionWrapper<R()> {
-		template <R(*FunctionPointer)()> static
-		int Invoke(State* state) {
-			return Push(state, FunctionPointer());
+		template <R(*function_pointer)()> static
+		int invoke(State* state) {
+			return push(state, function_pointer());
 		}
 	};
 
 	template <typename... A>
 	struct FunctionWrapper<void(A...)> {
-		template <void (*FunctionPointer)(A...)> static
-		int Invoke(State* state) {
-			Apply(state, FunctionPointer);
+		template <void (*function_pointer)(A...)> static
+		int invoke(State* state) {
+			apply(state, function_pointer);
 			return 0;
 		}
 	};
 
 	template <typename R, typename... A>
 	struct FunctionWrapper<R(A...)> {
-		template <R (*FunctionPointer)(A...)> static
-		int Invoke(State* state) {
-			return Push(
+		template <R (*function_pointer)(A...)> static
+		int invoke(State* state) {
+			return push(
 				state,
-				Apply(state, FunctionPointer)
+				apply(state, function_pointer)
 			);
 		}
 	};
@@ -62,7 +62,7 @@ namespace internal {
 
 /**
  * Assuming its parameters can be retrieved from the Lua stack, ordinary functions can be wrapped
- * using the `WrapFunction` instance in order to produce a C function which can be used by the
+ * using the `wrap_function` instance in order to produce a C function which can be used by the
  * Lua VM.
  *
  * Assuming your function has the following signature:
@@ -71,14 +71,14 @@ namespace internal {
  *
  * Generate a Lua-compatible like so:
  *
- *   CFunction wrapped_fun = WrapFunction<R(A0, A1 ... An), my_fun>;
+ *   CFunction wrapped_fun = wrap_function<R(A0, A1 ... An), my_fun>;
  */
 template <
 	typename S,
-	S* FunctionPointer
+	S* function_pointer
 >
-constexpr CFunction WrapFunction =
-	&internal::FunctionWrapper<S>::template Invoke<FunctionPointer>;
+constexpr CFunction wrap_function =
+	&internal::FunctionWrapper<S>::template invoke<function_pointer>;
 
 LUWRA_NS_END
 

+ 17 - 17
lib/luwra/stack.hpp

@@ -22,10 +22,10 @@ namespace internal {
 	template <typename R, typename T>
 	struct Layout<R(T)> {
 		template <typename F, typename... A> static inline
-		R Direct(State* state, int n, F hook, A&&... args) {
+		R direct(State* state, int n, F hook, A&&... args) {
 			return hook(
 				std::forward<A>(args)...,
-				Value<T>::Read(state, n)
+				Value<T>::read(state, n)
 			);
 		}
 	};
@@ -33,13 +33,13 @@ namespace internal {
 	template <typename R, typename T1, typename... TR>
 	struct Layout<R(T1, TR...)> {
 		template <typename F, typename... A> static inline
-		R Direct(State* state, int n, F hook, A&&... args) {
-			return Layout<R(TR...)>::Direct(
+		R direct(State* state, int n, F hook, A&&... args) {
+			return Layout<R(TR...)>::direct(
 				state,
 				n + 1,
 				hook,
 				std::forward<A>(args)...,
-				Value<T1>::Read(state, n)
+				Value<T1>::read(state, n)
 			);
 		}
 	};
@@ -59,7 +59,7 @@ namespace internal {
  * Given a function `R f(A0, A1, ... An)` you are able to map over
  * the values on the stack on the stack like so:
  *
- *   R my_result = Apply(lua_state, pos, f);
+ *   R my_result = apply(lua_state, pos, f);
  *
  * which is equivalent to
  *
@@ -68,32 +68,32 @@ namespace internal {
  * where x0, x1, ... xn are the values on the stack.
  */
 template <typename R, typename... A> static inline
-R Apply(State* state, int pos, R (*funptr)(A...)) {
-	return internal::Layout<R(A...)>::Direct(state, pos, funptr);
+R apply(State* state, int pos, R (*function_pointer)(A...)) {
+	return internal::Layout<R(A...)>::direct(state, pos, function_pointer);
 }
 
 /**
- * Same as `Apply(state, 1, funptr)`.
+ * Same as `apply(state, 1, function_pointer)`.
  */
 template <typename R, typename... A> static inline
-R Apply(State* state, R (*funptr)(A...)) {
-	return Apply(state, 1, funptr);
+R apply(State* state, R (*function_pointer)(A...)) {
+	return apply(state, 1, function_pointer);
 }
 
 /**
- * Specialization of `Apply` which works for `std::function`.
+ * Specialization of `apply` which works for `std::function`.
  */
 template <typename R, typename... A> static inline
-R Apply(State* state, int pos, std::function<R(A...)> fun) {
-	return internal::Layout<R(A...)>::Direct(state, pos, fun);
+R apply(State* state, int pos, std::function<R(A...)> function_object) {
+	return internal::Layout<R(A...)>::direct(state, pos, function_object);
 }
 
 /**
- * Same as `Apply(state, 1, fun)`.
+ * Same as `apply(state, 1, function_object)`.
  */
 template <typename R, typename... A> static inline
-R Apply(State* state, std::function<R(A...)> fun) {
-	return Apply(state, 1, fun);
+R apply(State* state, std::function<R(A...)> function_object) {
+	return apply(state, 1, function_object);
 }
 
 LUWRA_NS_END

+ 38 - 38
lib/luwra/types.hpp

@@ -34,21 +34,21 @@ struct Value {
 	 * Retrieve the value at position `n`.
 	 */
 	static
-	T Read(State*, int);
+	T read(State*, int);
 
 	/**
-	 * Push the value onto the stack.
+	 * push the value onto the stack.
 	 */
 	static
-	int Push(State*, T);
+	int push(State*, T);
 };
 
 /**
  * Convenient wrapped for `Value<T>::push`.
  */
 template <typename T> static inline
-int Push(State* state, T value) {
-	return Value<T>::Push(state, value);
+int push(State* state, T value) {
+	return Value<T>::push(state, value);
 }
 
 /**
@@ -60,12 +60,12 @@ int Push(State* state, T value) {
 	template <>                                                      \
 	struct Value<type> {                                             \
 		static inline                                                \
-		type Read(State* state, int n) {                             \
+		type read(State* state, int n) {                             \
 			return retrf(state, n);                                  \
 		}                                                            \
                                                                      \
 		static inline                                                \
-		int Push(State* state, type value) {                         \
+		int push(State* state, type value) {                         \
 			pushf(state, value);                                     \
 			return 1;                                                \
 		}                                                            \
@@ -89,7 +89,7 @@ int Push(State* state, T value) {
 
 #ifndef luaL_pushstdstring
 	/**
-	 * Push a `std::string` as string onto the stack.
+	 * push a `std::string` as string onto the stack.
 	 */
 	#define luaL_pushstdstring(state, stdstring) \
 		(lua_pushstring(state, stdstring.c_str()))
@@ -103,12 +103,12 @@ namespace internal {
 	template <>
 	struct NumericTransportValue<Integer> {
 		static inline
-		Integer Read(State* state, int index) {
+		Integer read(State* state, int index) {
 			return luaL_checkinteger(state, index);
 		}
 
 		static inline
-		int Push(State* state, Integer value) {
+		int push(State* state, Integer value) {
 			lua_pushinteger(state, value);
 			return 1;
 		}
@@ -118,12 +118,12 @@ namespace internal {
 	template <>
 	struct NumericTransportValue<Number> {
 		static inline
-		Number Read(State* state, int index) {
+		Number read(State* state, int index) {
 			return luaL_checknumber(state, index);
 		}
 
 		static inline
-		int Push(State* state, Number value) {
+		int push(State* state, Number value) {
 			lua_pushnumber(state, value);
 			return 1;
 		}
@@ -134,25 +134,25 @@ namespace internal {
 	template <typename I, typename B>
 	struct NumericContainedValueBase {
 		static constexpr
-		bool Qualifies =
+		bool qualifies =
 			std::numeric_limits<I>::max() < std::numeric_limits<B>::max()
 			&& std::numeric_limits<I>::min() > std::numeric_limits<B>::min();
 
 		static inline
-		I Read(State* state, int index) {
+		I read(State* state, int index) {
 			return
 				std::max<B>(
 					std::numeric_limits<I>::min(),
 					std::min<B>(
 						std::numeric_limits<I>::max(),
-						NumericTransportValue<B>::Read(state, index)
+						NumericTransportValue<B>::read(state, index)
 					)
 				);
 		}
 
 		static inline
-		int Push(State* state, I value) {
-			NumericTransportValue<B>::Push(state, static_cast<B>(value));
+		int push(State* state, I value) {
+			NumericTransportValue<B>::push(state, static_cast<B>(value));
 			return 1;
 		}
 	};
@@ -162,15 +162,15 @@ namespace internal {
 	template <typename I, typename B>
 	struct NumericTruncatingValueBase {
 		static inline
-		I Read(State* state, int index) {
-			return static_cast<I>(NumericTransportValue<B>::Read(state, index));
+		I read(State* state, int index) {
+			return static_cast<I>(NumericTransportValue<B>::read(state, index));
 		}
 
 		static inline
-		int Push(State*, I) {
+		int push(State*, I) {
 			static_assert(
 				sizeof(I) == -1,
-				"You shold not use 'Value<I>::Push' specializations which inherit from NumericTruncatingValueBase"
+				"You shold not use 'Value<I>::push' specializations which inherit from NumericTruncatingValueBase"
 			);
 		}
 	};
@@ -182,7 +182,7 @@ namespace internal {
 			std::is_same<I, B>::value,
 			NumericTransportValue<B>,
 			typename std::conditional<
-				NumericContainedValueBase<I, B>::Qualifies,
+				NumericContainedValueBase<I, B>::qualifies,
 				NumericContainedValueBase<I, B>,
 				NumericTruncatingValueBase<I, B>
 			>::type
@@ -223,7 +223,7 @@ LUWRA_DEF_VALUE(std::string, luaL_checkstring,  luaL_pushstdstring);
 template <>
 struct Value<CFunction> {
 	static inline
-	int Push(State* state, CFunction fun) {
+	int push(State* state, CFunction fun) {
 		lua_pushcfunction(state, fun);
 		return 1;
 	}
@@ -241,7 +241,7 @@ struct Arbitrary {
 template <>
 struct Value<Arbitrary> {
 	static inline
-	Arbitrary Read(State* state, int index) {
+	Arbitrary read(State* state, int index) {
 		if (index < 0)
 			index = lua_gettop(state) + (index + 1);
 
@@ -249,7 +249,7 @@ struct Value<Arbitrary> {
 	}
 
 	static inline
-	int Push(State* state, const Arbitrary& value) {
+	int push(State* state, const Arbitrary& value) {
 		lua_pushvalue(value.state, value.index);
 
 		if (value.state != state)
@@ -261,29 +261,29 @@ struct Value<Arbitrary> {
 
 namespace internal {
 	template <typename>
-	struct StackPusher;
+	struct Stackpusher;
 
 	template <size_t I>
-	struct StackPusher<std::index_sequence<I>> {
+	struct Stackpusher<std::index_sequence<I>> {
 		template <typename T> static inline
-		int Push(State* state, const T& package) {
-			// return Value<typename std::tuple_element<I, T>::type>::Push(state, std::get<I>(package));
-			return Push(state, std::get<I>(package));
+		int push(State* state, const T& package) {
+			// return Value<typename std::tuple_element<I, T>::type>::push(state, std::get<I>(package));
+			return push(state, std::get<I>(package));
 		}
 	};
 
 	template <size_t I, size_t... Is>
-	struct StackPusher<std::index_sequence<I, Is...>> {
+	struct Stackpusher<std::index_sequence<I, Is...>> {
 		template <typename T> static inline
-		int Push(State* state, const T& package) {
-			// int r = Value<typename std::tuple_element<I, T>::type>::Push(
+		int push(State* state, const T& package) {
+			// int r = Value<typename std::tuple_element<I, T>::type>::push(
 			// 	state,
 			// 	std::get<I>(package)
 			// );
 
-			int r = Push(state, std::get<I>(package));
+			int r = push(state, std::get<I>(package));
 
-			return std::max(0, r) + StackPusher<std::index_sequence<Is...>>::Push(state, package);
+			return std::max(0, r) + Stackpusher<std::index_sequence<Is...>>::push(state, package);
 		}
 	};
 }
@@ -294,13 +294,13 @@ namespace internal {
 template <typename... A>
 struct Value<std::tuple<A...>> {
 	static inline
-	std::tuple<A...> Read(State*, int) {
+	std::tuple<A...> read(State*, int) {
 		static_assert(sizeof(std::tuple<A...>) == -1, "std::tuples cannot be read from the stack");
 	}
 
 	static inline
-	int Push(State* state, const std::tuple<A...>& value) {
-		return internal::StackPusher<std::make_index_sequence<sizeof...(A)>>::Push(state, value);
+	int push(State* state, const std::tuple<A...>& value) {
+		return internal::Stackpusher<std::make_index_sequence<sizeof...(A)>>::push(state, value);
 	}
 };
 

+ 45 - 45
lib/luwra/usertypes.hpp

@@ -21,43 +21,43 @@ LUWRA_NS_BEGIN
 
 namespace internal {
 	static
-	std::atomic_size_t UserTypeCounter;
+	std::atomic_size_t user_type_counter;
 
 	template <typename T>
-	std::string UserTypeName = "";
+	std::string user_type_name = "";
 
 	template <typename T, typename... A>
-	int UserTypeConstructor(State* state) {
-		return internal::Layout<int(A...)>::Direct(
+	int construct_user_type(State* state) {
+		return internal::Layout<int(A...)>::direct(
 			state,
 			1,
-			&Value<T&>::template Push<A...>,
+			&Value<T&>::template push<A...>,
 			state
 		);
 	}
 
 	template <typename T>
-	int UserTypeDestructor(State* state) {
+	int destruct_user_type(State* state) {
 		if (!lua_islightuserdata(state, 1))
-			Value<T&>::Read(state, 1).~T();
+			Value<T&>::read(state, 1).~T();
 
 		return 0;
 	}
 
 	template <typename T>
-	int UserTypeToString(State* state) {
-		return Push(state, internal::UserTypeName<T>);
+	int stringify_user_type(State* state) {
+		return push(state, internal::user_type_name<T>);
 	}
 
-	template <typename T, typename R, R T::* PropertyPointer>
-	int UserTypeAccessor(State* state) {
+	template <typename T, typename R, R T::* property_pointer>
+	int access_user_type_property(State* state) {
 		if (lua_gettop(state) > 1) {
 			// Setter
-			(Value<T&>::Read(state, 1).*PropertyPointer) = Value<R>::Read(state, 2);
+			(Value<T&>::read(state, 1).*property_pointer) = Value<R>::read(state, 2);
 			return 0;
 		} else {
 			// Getter
-			return Push(state, Value<T&>::Read(state, 1).*PropertyPointer);
+			return push(state, Value<T&>::read(state, 1).*property_pointer);
 		}
 	}
 
@@ -74,9 +74,9 @@ namespace internal {
 		using MethodPointerType = R (T::*)(A...);
 		using FunctionSignature = R (T&, A...);
 
-		template <MethodPointerType MethodPointer> static
-		R Delegate(T& parent, A... args) {
-			return (parent.*MethodPointer)(std::forward<A>(args)...);
+		template <MethodPointerType method_pointer> static
+		R delegate(T& parent, A... args) {
+			return (parent.*method_pointer)(std::forward<A>(args)...);
 		}
 	};
 }
@@ -90,17 +90,17 @@ namespace internal {
 template <typename T>
 struct Value<T&> {
 	static inline
-	T& Read(State* state, int n) {
-		assert(!internal::UserTypeName<T>.empty());
+	T& read(State* state, int n) {
+		assert(!internal::user_type_name<T>.empty());
 
 		return *static_cast<T*>(
-			luaL_checkudata(state, n, internal::UserTypeName<T>.c_str())
+			luaL_checkudata(state, n, internal::user_type_name<T>.c_str())
 		);
 	}
 
 	template <typename... A> static inline
-	int Push(State* state, A&&... args) {
-		assert(!internal::UserTypeName<T>.empty());
+	int push(State* state, A&&... args) {
+		assert(!internal::user_type_name<T>.empty());
 
 		void* mem = lua_newuserdata(state, sizeof(T));
 
@@ -113,7 +113,7 @@ struct Value<T&> {
 		new (mem) T(std::forward<A>(args)...);
 
 		// Set metatable for this type
-		luaL_getmetatable(state, internal::UserTypeName<T>.c_str());
+		luaL_getmetatable(state, internal::user_type_name<T>.c_str());
 		lua_setmetatable(state, -2);
 
 		return 1;
@@ -128,23 +128,23 @@ struct Value<T&> {
 template <typename T>
 struct Value<T*> {
 	static inline
-	T* Read(State* state, int n) {
-		assert(!internal::UserTypeName<T>.empty());
+	T* read(State* state, int n) {
+		assert(!internal::user_type_name<T>.empty());
 
 		return static_cast<T*>(
-			luaL_checkudata(state, n, internal::UserTypeName<T>.c_str())
+			luaL_checkudata(state, n, internal::user_type_name<T>.c_str())
 		);
 	}
 
 	static inline
-	int Push(State* state, T* instance) {
-		assert(!internal::UserTypeName<T>.empty());
+	int push(State* state, T* instance) {
+		assert(!internal::user_type_name<T>.empty());
 
-		// Push instance as light user data
+		// push instance as light user data
 		lua_pushlightuserdata(state, instance);
 
 		// Set metatable for this type
-		luaL_getmetatable(state, internal::UserTypeName<T>.c_str());
+		luaL_getmetatable(state, internal::user_type_name<T>.c_str());
 		lua_setmetatable(state, -2);
 
 		return 1;
@@ -157,16 +157,16 @@ struct Value<T*> {
  * Meta-methods can be added and/or overwritten aswell.
  */
 template <typename T> static inline
-void RegisterUserType(
+void register_user_type(
 	State* state,
 	const std::map<const char*, CFunction>& methods,
 	const std::map<const char*, CFunction>& meta_methods = {}
 ) {
 	// Setup an appropriate meta table name
-	if (internal::UserTypeName<T>.empty())
-		internal::UserTypeName<T> = "UD#" + std::to_string(internal::UserTypeCounter++);
+	if (internal::user_type_name<T>.empty())
+		internal::user_type_name<T> = "UD#" + std::to_string(internal::user_type_counter++);
 
-	luaL_newmetatable(state, internal::UserTypeName<T>.c_str());
+	luaL_newmetatable(state, internal::user_type_name<T>.c_str());
 
 	// Register methods
 	if (methods.size() > 0 && meta_methods.count("__index") == 0) {
@@ -185,14 +185,14 @@ void RegisterUserType(
 	// Register garbage-collection hook
 	if (meta_methods.count("__gc") == 0) {
 		lua_pushstring(state, "__gc");
-		lua_pushcfunction(state, &internal::UserTypeDestructor<T>);
+		lua_pushcfunction(state, &internal::destruct_user_type<T>);
 		lua_rawset(state, -3);
 	}
 
 	// Register string representation function
 	if (meta_methods.count("__tostring") == 0) {
 		lua_pushstring(state, "__tostring");
-		lua_pushcfunction(state, &internal::UserTypeToString<T>);
+		lua_pushcfunction(state, &internal::stringify_user_type<T>);
 		lua_rawset(state, -3);
 	}
 
@@ -212,10 +212,10 @@ void RegisterUserType(
  * to use during construction.
  */
 template <typename T, typename... A>
-constexpr CFunction WrapConstructor = &internal::UserTypeConstructor<T, A...>;
+constexpr CFunction wrap_constructor = &internal::construct_user_type<T, A...>;
 
 /**
- * Works similiar to `WrapFunction`. Given a class or struct declaration as follows:
+ * Works similiar to `wrap_function`. Given a class or struct declaration as follows:
  *
  *   struct T {
  *     R my_method(A0, A1 ... An);
@@ -223,7 +223,7 @@ constexpr CFunction WrapConstructor = &internal::UserTypeConstructor<T, A...>;
  *
  * You might wrap this method easily:
  *
- *   CFunction wrapped_meth = WrapMethod<T, R(A0, A1 ... An), &T::my_method>;
+ *   CFunction wrapped_meth = wrap_method<T, R(A0, A1 ... An), &T::my_method>;
  *
  * In Lua, assuming `instance` is a userdata instance of type `T`, x0, x1 ... xn are instances
  * of A0, A1 ... An, and the method has been bound as `my_method`; it is possible to invoke the
@@ -234,12 +234,12 @@ constexpr CFunction WrapConstructor = &internal::UserTypeConstructor<T, A...>;
 template <
 	typename T,
 	typename S,
-	typename internal::MethodWrapper<T, S>::MethodPointerType MethodPointer
+	typename internal::MethodWrapper<T, S>::MethodPointerType method_pointer
 >
-constexpr CFunction WrapMethod =
-	WrapFunction<
+constexpr CFunction wrap_method =
+	wrap_function<
 		typename internal::MethodWrapper<T, S>::FunctionSignature,
-		internal::MethodWrapper<T, S>::template Delegate<MethodPointer>
+		internal::MethodWrapper<T, S>::template delegate<method_pointer>
 	>;
 
 /**
@@ -251,14 +251,14 @@ constexpr CFunction WrapMethod =
  *
  * The wrapped property accessor is also a function:
  *
- *   CFunction wrapped_property = WrapProperty<T, R, &T::my_property>;
+ *   CFunction wrapped_property = wrap_property<T, R, &T::my_property>;
  */
 template <
 	typename T,
 	typename R,
-	R T::* PropertyPointer
+	R T::* property_pointer
 >
-constexpr CFunction WrapProperty = &internal::UserTypeAccessor<T, R, PropertyPointer>;
+constexpr CFunction wrap_property = &internal::access_user_type_property<T, R, property_pointer>;
 
 LUWRA_NS_END