icon picker

Every file in Mochaccino is a package. It can contain functionality for a specific feature, or be part of a bigger feature.


The package keyword is used to define the name of that package (file), which other packages can use when referring to it.


The include keyword is used to import other packages from the same project into the current package.
package demopack;
include somePack;
include somePack2;
The objects exposed by the included packages will be imported directly, and you do not need to use a prefix to access them.
package demopack;
include somePack;
include somePack2;

someMethod(); // a method defined in somePack
But what if you want to import a file that is not from the project, or one that is hosted on Github? The dock keyword is the tool for this job.


The dock keyword declares a list of imports separated by commas.
package demopack;
include somePack;
include somePack2;

dock {
foo from "" as f,
* from "Users/Me/files/code.moc",


The from keyword seen above allows you to import specific modules or structs from the file in question.


The as keyword defines an alias for the imported package or objects. The defined prefix needs to be used to access objects from that package or the package itself.
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
) instead.