Narrator: "Was this ever asked for?"
Also Narrator: "I don't think it was."
About | Reasoning | Supported Platforms | Use
mangle is a post processing name mangler for luau, inspired by Python's name mangler; what makes private variables private in Python.
In most intro to programming courses, we learn of public and private classes and variables. These concepts are less about security and more about managing complexity. If a private variable causes a bug, the developer only needs to look within the class that its located.
mangle may be posted on Wally. We understand the use case is minimal.
local mangle = require(--[[path to mangle]])
local someClass = {}
-- "public" variables and functions of someClass
-- "private" varaibles and functions using "__" in the start of their names.
reutrn mangle(someClass)Calling someClass.__someFunction or someClass.__someVariable directly is not allowed and will fatally error. However, a function inside the someClass class can still call on __someFunction or __someVariable without problem.