Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Final Keyword

Types, methods, and fields can be made 'final' using the 'final' keyword. This prevents fields and methods from being overridden by any type which mixes them in. If a type is made final, all fields and methods of that type are made final.

Code Block
type FinalType {
    final method: function(): string
}

C3.ai developer resources on the final keyword

Abstract Types

The C3 AI Suite also supports abstract types. If you use the keyword 'abstract' before the type definition, this will indicate an abstract type. You cannot instantiate an abstract type, and must mix it into another concrete type. This provides a great way to standardize interfaces. Here's an example:

Code Block
abstract type Interace {
	field1: int
    method1: function(double): int
}

C3.ai developer resources on Abstract types:

Examples

Look through the lightbulbAD package and find .c3typ files. Look at these to see the range of possibilities