dansanderson/picotool

include()/import() "macro"

tobiasvl opened this issue · 2 comments

It would be nice with a include() or import() function which (unlike require()) worked exactly like a simple macro, and spliced the contents of the file argument into the target file.

This would not incur any token overhead, just make it easier to spread development over several files (for easier git blame, cleaner code, etc.).

See also #44.

honestly I am not sure why this isn't default behavior or require, runtime load is really dumb for pico 8 constraints...

The intent of require() is to mimic the Lua feature's namespace management properties. Required libraries can be treated as modules instead of lexical inclusion.

I'm going to resolve this as will-not-fix because PICO-8 now has its own preprocessor #include for lexical inclusion. Separately, picotool needs to support #include somehow, probably specific to conversions from .p8 to non-.p8 formats.