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

Location info for functions on API tables

Started by Lupus590, 26 July 2015 - 09:17 PM
Lupus590 #1
Posted 26 July 2015 - 11:17 PM
Basically a column in the table which tells you the file path in the CC jar for the lua file which declares the function or if the function is declared in java.

I can start modifying the wiki pages myself (I've had a wiki account for a while now) but as this is a big thing I want a go ahead before doing it.
Bomb Bloke #2
Posted 27 July 2015 - 12:59 AM
If I were going to do such a thing, I'd do it in the form of a link to file within one of the repos tracking the changes between builds. Eg.
MKlegoman357 #3
Posted 27 July 2015 - 05:31 AM
I don't think this is needed. Most of the APIs are easy to find anyway, s they are saved under the same name as themselves.
Lupus590 #4
Posted 27 July 2015 - 08:54 AM
True, MKlegoman, but the OS API is a big exception. In my opinion, knowing a function is implemented java side will be useful. (My plan is an OS which overwrites rom files (with backup) - it will be distributed via a resource pack - this is why I want this information)
Edited on 27 July 2015 - 06:54 AM
MKlegoman357 #5
Posted 27 July 2015 - 10:58 AM
Well, then someone would have to be tracking all of the functions and whether they were changed or not, because a change were a function is implemented Lua side (before it being Java side) might happen pretty silently and I'm pretty sure that that has happened before. Also, it depends on what you're classifying as a Java or Lua side function. If by Java you mean implemented in Java side then it would mean os.clock is not a Java function, but a Lua function. But if you mean Java function is a function which isn't defined in the rom files (nor bios.lua) then os.clock is a Java function and not a Lua function.

You can find which functions are pure-Java by tostring'ing them. In LuaJ, all pure-Java functions when converted to a string don't output something like 'function: 467aB86c', but rather their actual name. Try typing 'error' into Lua program.

Oh, looks like the CC's APIs just behave as if they were Lua-side APIs.
Edited on 27 July 2015 - 09:22 AM