Types describe how values behave and what they are made of. Since everything in Jam is a value, types are also values and can be used as such.
A type may be explicitly marked as nullable, meaning that the null value may
be assigned to it. A nullable type does not allow member access unless the value
is checked for null, or is cast to the type’s non-nullable counterpart.
A type may be marked as nullable either at definition or declaration.
A class is a user defined type. A class may have instance fields and methods, which can be accessed as attributes. It may also inherit functionality from other types, or include functionality from Traits.
Since a core concept of Jam is that everything is an object, and objects have types, classes must therefore also have a type. The type of a class is called a metaclass. A metaclass is a class whose instances are classes, as such they define the attributes and functionality of the class itself.
Note
There is no syntax for metaclasses yet.
Nullable ::=Value["?"] InstanceVariable ::=Variable[ "="Value] ClassMethod ::=Method|TypeCastDef|OperationDefTypeCastDef ::=ImplicitCastDef|ExplicitCastDefImplicitCastDef ::= "def" "self" ":"ValueInstructionSet"end" ExplicitCastDef ::= "def" "self" "as"ValueInstructionSet"end" OperationDef ::=BinaryOperationDef|UnaryOperationDefBinaryOperationDef ::= "def" "self"BinaryOperationArgument[ "->"Value] UnaryOperationDef ::= "def"UnaryOperation"self" [ "->"Value] ClassInstruction ::=ClassConstructor|InstanceVariable|ClassMethodClassInstructionSet ::= (ClassInstruction\n )* ClassConstructorPrototype ::= "(" [ [Argument","]*Argument] ")" ClassConstructor ::= "new"ClassConstructorPrototypeInstructionSet"end" ClassPrototype ::=Identifier["?"] [ "("Value")" ] Class ::= "class"ClassPrototypeClassInstructionSet"end"