Modules should, instead of sharing a common global scope, be able to define what values they export via the injected variable export. The contents of this variable will be the result of the load or require call.
Example:
awesome-library/main.charly
class MyAwesomeClass {
# code
};
export = MyAwesomeClass;
# More code follows
main.charly
let myClass = require("awesome-library");
print(myClass); # MyAwesomeClass
Modules should, instead of sharing a common global scope, be able to define what values they export via the injected variable
export
. The contents of this variable will be the result of theload
orrequire
call.Example:
awesome-library/main.charly
main.charly