Closures
Overview of the Closures libraries
The closure library in RbxStu V3 provides functions to manipulate and work with closures. These allow you to wrap and hook functions.
Why?
When attempting to debug or modify an environment to your needs, you cannot simply make your metamethod be a Luau closure, as, in ROBLOX, the game global (The DataModel
), cannot have its metatable be modified, and if it is, its metamethods should ALWAYS be C closures and never Luau closures. This is why the library contains methods to wrap existing Luau closures into C closures and, should it ever be required, C closures to Luau closures.
Remarks
This section includes reflective
functions such as loadstring
, that do not fit within the Reflection
libraries category due to them targeting Instance
s, not the language itself.
The closures library has slight modifications to account for Luau and other needs that the modern developer expects.
Last updated