Dodo doc > Macros and Templates > Templates > Type With Attributes
This is the simplest way to define a family of types.
To apply it, simply declare a type attribute in the type. It is then possible to create a new type by using the type as prototype and changing this attribute value.
Example:
class String: supportedEncoding String.encoding = utf8 ... . def LatinString = new String(encoding: latin1)
There is a special shorthand syntax that allows the derived type be used in a variable declaration. It is written by enclosing the attributes in angled brackets.
Example:
String(<encoding: latin1>) latinString