diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-04-06 22:45:02 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-04-06 22:45:02 -0400 |
| commit | 44cd26f2cebd760a53aa4ff1b7779e718a101650 (patch) | |
| tree | 4bdc9144c6825a0c394155712d5e464ee2a61061 /docs/metamethods.md | |
| parent | 3406515a44b13d0c290c28ac42bd364ce27560c7 (diff) | |
Rename Array -> List in all code and docs
Diffstat (limited to 'docs/metamethods.md')
| -rw-r--r-- | docs/metamethods.md | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/docs/metamethods.md b/docs/metamethods.md index 0983aff0..f47c8233 100644 --- a/docs/metamethods.md +++ b/docs/metamethods.md @@ -31,17 +31,17 @@ enums. At this time, metamethods may not be overridden. ## Generic Metamethods -Due to the presence of pointers, arrays, tables, and functions, there are +Due to the presence of pointers, lists, tables, and functions, there are potentially a very large number of metamethods that would be required if _every_ type had its own set of metamethods. To reduce the amount of generated code, Tomo uses generic metamethods, which are general-purpose functions that take an object pointer and a type info struct pointer that has metadata about the object's type. That metadata is added automatically at compile time and -used to perform the appropriate operations. As an example, every array follows +used to perform the appropriate operations. As an example, every list follows the same logic when performing comparisons, except that each item is compared -using the item's comparison function. Therefore, we can compile a single array -comparison function and reuse it for each type of array if we pass in some -metadata about how to compare the array's items. +using the item's comparison function. Therefore, we can compile a single list +comparison function and reuse it for each type of list if we pass in some +metadata about how to compare the list's items. When possible, we avoid calling metamethods (for example, doing fixed-sized integer comparisons does not require calling a function), but metamethods are |
