SAWScript has a feature where after loading and executing a file, if it finds something called main in the global environment it then executes that.
This feature is not widely known, not widely used, and does not serve any real purpose.
Handling the panic in #2556 (in which this would try to execute anything, whether or not it was executable) also revealed that it's almost entirely undocumented. Furthermore, the checks require to avoid the panic while not also making the identifier main effectively reserved are annoying, complicated, and probably not very robust.
Rather than wasting energy documenting it, it seems like it might be a better idea to just deprecate the feature.
It's not a builtin but we can use the same process: initially if we find an executable main warn and execute it, later if we find an executable main fail, then delete the code entirely.
SAWScript has a feature where after loading and executing a file, if it finds something called
mainin the global environment it then executes that.This feature is not widely known, not widely used, and does not serve any real purpose.
Handling the panic in #2556 (in which this would try to execute anything, whether or not it was executable) also revealed that it's almost entirely undocumented. Furthermore, the checks require to avoid the panic while not also making the identifier
maineffectively reserved are annoying, complicated, and probably not very robust.Rather than wasting energy documenting it, it seems like it might be a better idea to just deprecate the feature.
It's not a builtin but we can use the same process: initially if we find an executable
mainwarn and execute it, later if we find an executablemainfail, then delete the code entirely.