Revision Difference
Specific_Operators#561623
<cat>Dev.GettingStarted</cat>
Garry's Mod features a set of non-default operators and aliases of already existing ones.⤶
⤶
The implemented operators include:⤶
⤶
⤶
⤶
Operator |
-----------|⤶
| `continue` |⤶
⤶
<warning>`continue` may work incorrectly in `repeat-until` loops, consider using `goto`</warning>⤶
⤶
The implemented aliases are as following:⤶
⤶
⤶
⤶
Operator | Alias |⤶
----------|------- |⤶
| `and` | `&&` |⤶
| `or` | `||` |⤶
| `not` | `!` |⤶
| `~=` | `!=` |⤶
| `--[[ ]]` | `/* */` |⤶
| `--` | `//` |⤶
⤶
⤶
⤶
⤶
⤶
<warning>It is suggested to avoid using the custom operators if you wish to use your scripts outside of Garry's Mod, as they are incompatible with standard Lua.</warning><title> Operators & Aliases </title>⤶
⤶
# Operators & Aliases⤶
⤶
Garry's Mod adds a custom operator and aliases various native Lua operators.⤶
⤶
| Garry's Mod <br/> Operator | Note |
|:---:|:----------------------------|⤶
| `continue` | Consider using `goto` for `repeat-until` loops instead.⤶
⤶
| Lua | Garry's Mod <br/> Alias |⤶
|:---:|:-----------------------:|⤶
| `and` | `&&`⤶
| `or` | `||`⤶
| `not` | `!`⤶
| `~=` | `!=`⤶
| `--[[ ]]` | `/* */`⤶
| `--` | `//`⤶
⤶
<warning>⤶
⤶
If you want to keep your code compatible with other Lua environments, ⤶
it's recommended to **avoid** using these **custom operators** & **aliases**.⤶
⤶
</warning>⤶