Taxonomy of a Rule

Throughout the Caster documentation, you will see references to rule, command, spec, action, extra, and defaults. These all refer to parts of a Rule, typically a MappingRule or MergeRule. Both are structured the same way, as depicted below.

  • spec : This is what you say in order to invoke an action.
  • action : This is what happens when you speak a spec. Examples include Dragonfly's Key, Text, and Function actions, or Caster's R, ContextSeeker, or AsynchronousAction actions.
  • command : The combination of a spec and an action. In MappingRules or MergeRules, these are key/value pairs.
  • extra : A sub-component of a spec. Examples include Dragonfly's Dictation, IntegerRef, and Choice, or Caster's Boolean.
  • default : A default value for an extra. Optional extras in a spec should have default values.
  • rule : Any of the classes which extend Dragonfly's Rule class, but most commonly, MappingRule and MergeRule.