HaxeFoundation / HaxeFoundation/haxe

[Compat] use _ENV.arg in lua instead of _G.arg

Open
#10,307 3 comments 0 reactions 1 assignee Claimed by @jdonaldson View on GitHub
platform-lua
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.