HaxeFoundation / HaxeFoundation/haxe
[Compat] use _ENV.arg in lua instead of _G.arg
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
Haxe is a useful language for programming lua with stronger types, however, I have run into the issue that some lua "os"'s can't run haxe programs that utilize arguments. This is because haxe uses _G.arg, while these "os" believe arguments are local to a program's _ENV not _G. This specifically affects the minecraft mod ComputerCraft and means adding an extra build step to haxe programs that adds `_G.arg = _ENV.arg` at the start of every file.
Theoretically, this won't affect haxe programs since they usually run in a single lua file, so the _ENV and _G serve the same purpose.
Lua cli supports `_G.arg`, `_ENV.arg`, and `{ ... }`
Contributor guide
Assessment
This issue has not been assessed yet.