This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
cntkillme's profile picture

require function

Started by cntkillme, 19 May 2017 - 01:06 AM
cntkillme #1
Posted 19 May 2017 - 03:06 AM
I assume this has probably been requested plenty of times but all the alternatives I read weren't any good.

os.loadAPI clutters the global environment and forces the name of the API to be the file name.
dofile requires the script to be recompiled every time.
os.run is just not a good solution either.

Why doesn't require exist? I mean sure it's easy to implement on our own but having it be an actual feature makes it so we don't have to create a startup script for each computer just to do it.

I understand there is overhead but again if the package table can be accessed we can free libraries we no longer need to use.
KingofGamesYami #2
Posted 19 May 2017 - 03:18 AM
It exists.

/thread
cntkillme #3
Posted 19 May 2017 - 03:32 AM
Oh my god it was literally added yesterday LOL gg