Syntax


Syntax


Top Level

At the top level, a file is comprised of a series of imports followed by a series of declarations, which is typically a single class or interface.

Imports

Import a namespace:

import my.name.space ;

Import a namespace with an alias, meaning that rather than have the members of the namespace be directly accessible, they are instead accessed by qualifying them with the alias namespace.

import my.name.space as mns ; // my.name.space contains myclass
var myobj = mns.myclass() ;

Import the members of a static class directly, meaning they can be accessed without needing to prefix them with the class name:

import static std.io.term ;
prln( "Hello!" ) ; // prln is a member of static class term

Import the members of a static class, but with an alias, effectively making a static class available under a different name.

import static std.io.term as t ;
t.prln( "Hello!") ;

Declarations

Declare a class, interface, or entrypoint.

class myclass ;
interface _myiface ;
entrypoint myep ;

This page is a work in progress. More content will be available over time.