charly-lang / charly

🐈 The Charly Programming Language | Written by @KCreate
https://charly-lang.github.io/charly/
MIT License
199 stars 10 forks source link

Real modules #50

Closed KCreate closed 8 years ago

KCreate commented 8 years ago

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
KCreate commented 8 years ago

Implemented in #54