Traits

Traits are defined using TRAITDEF(...):

TRAITDEF("Philosophical") := BLOCK(
  DEF("philosophize") := BLOCK(
    LIT(0)
  ) 
)
(CLASSDEF("Animal"): Tree)
(TRAITDEF("HasLegs"): Tree)
CLASSDEF("Frog")
    withParents("Animal", "HasLegs", "Philosophical") := BLOCK(
  DEF(Any_toString) withFlags(Flags.OVERRIDE) := LIT("green")
)

These print as:

trait Philosophical {
  def philosophize {
    0
  }
}

class Animal

trait HasLegs

class Fogs extends Animal with HasLegs with Philosophical {
  override toString = "green"
}