We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 02f8e18 commit 5339f1dCopy full SHA for 5339f1d
docs/New Features/Mindex Metamethod.md
@@ -8,8 +8,7 @@ In this code, the following occurs:
8
2. `__index` returns nil.
9
3. Since `__index` returned nil and this lookup is being performed by method invocation syntax (`:`), `__mindex` is queried.
10
11
-Another example:
12
-```pluto
+```pluto title="An example showing how __mindex is walked recursively so :insert still works with a custom __mindex"
13
local t = setmetatable({}, {
14
__mindex = {
15
function sum()
@@ -27,8 +26,7 @@ print(t.sum) --> nil
27
26
print(t:sum()) --> 3
28
```
29
30
-Beware of a caveat:
31
+```pluto title="An example showing __index taking precedence"
32
local t = { 1, 2 }
33
print(t:min()) --> 1
34
t.min = 1
0 commit comments