I can define that boot function as a static function field. It'll work just the same, and I can avoid cluttering up genlua.ml.
@@ -1306,9 +1306,6 @@ let generate com =
List.iter (generate_type_forward ctx) com.types;
newline ctx;
- (* add the unpack function. *)
- spr ctx "lua.Boot.unpack = function(...) return arg end"; newline ctx;
-
List.iter (generate_type ctx) com.types;
let rec chk_features e =
if is_dynamic_iterator ctx e then add_feature ctx "use.$iterator";
@@ -22,6 +22,7 @@
package lua;
class Boot {
+ public static var unpack : Dynamic->lua.Table<Int,Dynamic> = untyped __lua__("function(...) return {...} end");
private static function __unhtml(s : String) {
return s.split("&").join("&").split("<").join("<").split(">").join(">");