-
Notifications
You must be signed in to change notification settings - Fork 0
Modules
Joakim edited this page Oct 25, 2021
·
17 revisions
A module's last evaluated expression is implicitly exported. By convention, an object.
sum: (a, b) -> a + b
diff: (a, b) -> a - b
[sum, diff]
import module: 'module.kesh'
import [foo]: 'module.kesh'
import [foo as alias]: 'module.kesh'
import [foo, bar]: 'module.kesh'
import 'module.kesh'
The import
declaration can also import individual items from the global
object.
import [JSON, Promise, Math]
import window
This programming language only exists as a design. I'm unlikely to ever get the chance to write a compiler for it.
Feel free to steal any parts of it that you like. Ideas are better stolen than forgotten. (They're not my ideas anyway.)