@@ -387,6 +387,13 @@ pub const Lua = struct {
387387 if (c .lua_dump (lua .state , writer , data ) != 0 ) return error .Fail ;
388388 }
389389
390+ /// Returns true if the two values at the indexes are equal following the semantics of the
391+ /// Lua == operator.
392+ /// See https://www.lua.org/manual/5.1/manual.html#lua_equal
393+ pub fn equal (lua : * Lua , index1 : i32 , index2 : i32 ) bool {
394+ return c .lua_equal (lua .state , index1 , index2 ) == 1 ;
395+ }
396+
390397 /// Raises a Lua error using the value at the top of the stack as the error object
391398 /// Does a longjump and therefore never returns
392399 /// See https://www.lua.org/manual/5.4/manual.html#lua_error
@@ -573,6 +580,12 @@ pub const Lua = struct {
573580 return c .lua_isuserdata (lua .state , index ) != 0 ;
574581 }
575582
583+ /// Returns true if the value at index1 is smaller than the value at index2, following the
584+ /// semantics of the Lua < operator.
585+ pub fn lessThan (lua : * Lua , index1 : i32 , index2 : i32 ) bool {
586+ return c .lua_lessthan (lua .state , index1 , index2 ) == 1 ;
587+ }
588+
576589 /// Loads a Lua chunk without running it
577590 /// If there are no errors, pushes the compiled chunk on the top of the stack as a function
578591 /// See https://www.lua.org/manual/5.4/manual.html#lua_load
0 commit comments