[I've CC 1.5]
I usually read the built in programs for some inspiration, and I found something I can hardly explain. In the shell, there are local variables like sPath or tEnv declared at the beginning which give the paths to search the programs, or the environment used at this level of shell, and everything goes well, we can access to sPath with shell.path and shell.setPath, and tEnv is well used while running programs, new shells included.
And now, in the bios, before the declaration of os.loadAPI, there is a local table declared to ensure that an API is not loaded twice. But that doesn't work at all! When I call os.loadAPI on the same API twice in the lua prompt, or even twice on a row in the same program, I do not raise the error "API "..sName.." is already being loaded". I'm very curious to know how it works. I haven't yet tried to load twice the same API in the bios, cause I didn't fell like changing it, but I think this could be very informative.
My hypothesis, though I do not convince myself, is that the bios isn't compiled by a regular loadstring (maybe by a Java one).
definition of os.loadAPI in the bios :
Spoiler
definition of sPath in the shell program :
Spoiler
shell.path and shell.setPath :
Spoiler
Shell.programs using sPath :
Spoiler












