Posted 03 September 2018 - 10:37 AM
When you use os.loadAPI all global functions and variables are loaded in as if they are part of the API class e.g.
I am creating an Object Oriented application where I define classes in separate files. The syntax for this in computercraft gets pretty unwieldy:
Since each file contains only that class naming it to something different makes no sense.
My question is can I import MyClass directly to avoid the extra verbosity? Something similar to:
in python (for those of you who know it).
Is this possible?
os.loadAPI("myAPI")
print(myAPI.myVariable)
I am creating an Object Oriented application where I define classes in separate files. The syntax for this in computercraft gets pretty unwieldy:
os.loadAPI("MyClass")
MyClass.MyClass:new()
Since each file contains only that class naming it to something different makes no sense.
My question is can I import MyClass directly to avoid the extra verbosity? Something similar to:
from MyClass import MyClass
in python (for those of you who know it).
Is this possible?