dansanderson / picotool

Tools and Python libraries for manipulating Pico-8 game files. http://www.lexaloffle.com/pico-8.php
MIT License
367 stars 46 forks source link

include()/import() "macro" #53

Closed tobiasvl closed 2 years ago

tobiasvl commented 5 years ago

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.

Enerccio commented 3 years ago

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

dansanderson commented 2 years ago

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.