How compatible with Lua is Pluto?
Pluto is 99.9% compatible with most Lua source code. However, it's imperfect. Due to that, Pluto implements several compatibility macros.
Where are the incompatibilities?
Pluto adds the following reserved tokens:
Which means you can't use them as variable names or for function calls. They can still be used with short-hand table indexes and goto labels though, because Pluto removes the restriction from them.
Compatibility mode is a per-keyword option that adds a
pluto_ prefix. For example,
pluto_switch under compatibility mode. However, when compatibility mode is disabled, the
pluto_ syntax is still valid. This project has high regard for smooth migration paths.
Configuration for scripters
You can change the meaning of Pluto's reserved tokens at any point in your scripts by using
pluto_use * = false, switchenables compatibility mode for all keywords except for
pluto_use * = falseenables compatibility mode for all keywords.
pluto_use switchdisables compatibility mode for the
pluto_use switch = truewould be another way of writing this.
pluto_use "0.2.0"enables compatibility mode for all keywords except for:
pluto_use "0.5.0"enables compatibility mode for all keywords except for:
pluto_use "0.6.0"enables compatibility mode for all keywords except for:
Configuration for integrators
The macros for compatibility mode are well-documented, and found inside your
Portability & proactive compatibility
We recommend scripters place a
pluto_use statement at the beginning of their scripts for two reasons:
- Portability. This will override the compatibility mode settings compiled into Pluto so your script will be parsed identically in all Pluto environments.
- Proactive compatibility. Any keywords added by future versions of Pluto will also be put in compatibility mode by these statements, so in the off-chance your script uses a future reserved keyword as a variable name, it would still parse as you intended when you wrote it.
Plus, it's as simple as
pluto_use "0.6.0" or
pluto_use "0.5.0" — see "Configuration for scripters" above.