Env.: Add note discouraging modifying the stdlib

This commit is contained in:
Lars Müller 2022-09-12 07:40:58 +02:00 committed by GitHub
parent 2b1238402e
commit d7fa11434e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -48,7 +48,7 @@ Warnings are identified by their location as returned by `debug.getinfo` (`short
WARNING: Accessing undeclared global variables will be an order of magnitude slower than accessing declared globals due to the executed strictness checking code.
TIP: These warnings are only triggered at run time as the global variable access or assignment occurs. It is recommended to use a linter like [`luacheck`](https://github.com/mpeterv/luacheck) to detect mistaken global variable usage statically at the time of development.
TIP: These warnings are only triggered at run time as the global variable access or assignment occurs. It is recommended to use a linter like https://github.com/mpeterv/luacheck[`luacheck`] to detect mistaken global variable usage statically at the time of development.
=== Checking for global existence
@ -64,6 +64,8 @@ NOTE: This wraps `rawget(_G, name)` in the end but might be considered more read
== Standard Library Extensions
NOTE: It is considered bad practice to extend the standard library yourself, as this may collide with other mods doing the same as well as future engine changes including Lua version upgrades. Put your extensions into distinct API tables instead of modifying Lua's builtin libraries.
=== `math`
==== `math.hypot(x, y)`