mirror of
https://github.com/luau-lang/luau.git
synced 2024-11-15 14:25:44 +08:00
docs: fix minor typos (#8)
This commit is contained in:
parent
44cdeb07cc
commit
41564d281c
@ -101,7 +101,7 @@ Floor division is less harmful, but it's used rarely enough that `math.floor(a/b
|
||||
| new implementation for math.random | ✔️ | our RNG is based on PCG, unlike Lua 5.4 which uses Xoroshiro |
|
||||
| optional `init` argument to `string.gmatch` | 🤷♀️ | no strong use cases |
|
||||
| new functions `lua_resetthread` and `coroutine.close` | ❌ | not useful without to-be-closed variables |
|
||||
| coersions string-to-number moved to the string library | 😞 | we love this, but it breaks compatibility |
|
||||
| coercions string-to-number moved to the string library | 😞 | we love this, but it breaks compatibility |
|
||||
| new format `%p` in `string.format` | 🤷♀️ | no strong use cases |
|
||||
| `utf8` library accepts codepoints up to 2^31 | 🤷♀️ | no strong use cases |
|
||||
| The use of the `__lt` metamethod to emulate `__le` has been removed | 😞 | breaks compatibility and doesn't seem very interesting otherwise |
|
||||
|
@ -49,7 +49,7 @@ The same optimization is applied to the custom globals declared in the script, a
|
||||
|
||||
## Importing global access chains
|
||||
|
||||
While global access for library functions can be optimized in a similar way, this optimization breaks down when the global table is using sandboxing through metatables, and even when globals aren't sandoxed, `math.max` still requires two table accesses.
|
||||
While global access for library functions can be optimized in a similar way, this optimization breaks down when the global table is using sandboxing through metatables, and even when globals aren't sandboxed, `math.max` still requires two table accesses.
|
||||
|
||||
It's always possible to "localize" the global accesses by using `local max = math.max`, but this is cumbersome - in practice it's easy to forget to apply this optimization. To avoid relying on programmers remembering to do this, Luau implements a special optimization called "imports", where most global chains such as `math.max` are resolved when the script is loaded instead of when the script is executed.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user