Question about loading/running .pdz files

,

New to Lua so I could just be missing something here, but I'm unsure about the functionality of playdate.file.load() and playdate.file.run(). I have no problem loading them into the global namespace _G, but I don't know how to properly load them into a table. I can supply the [env] value to a file.load() but I'm unsure the proper way to access it, and if I supply a table to the [env] value of file.run() it causes a crash. I think I may just be completely unsure of their intended use. Any advice on this? I have a workaround where I define the returned function of load() as variable and access things that way but I feel like the intended use of these would be cleaner.

Take a look here

1 Like