Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
maxLevel1

Each ruleset installed in a pico can endow it with entity variables, which are specific to that pico and that ruleset. Together, the entity variables of all of the rulesets installed in a pico provide the pico with its persistent state.

Until a value is first assigned to an entity variable in a rule postlude, the value of the variable will be null. There are various techniques which can be used to deal with this issue.

The defaultsTo operator

The defaultsTo operator can provide a default value when an entity variable is used in a read-only context. For example, suppose ent:owners will be a map, but might not have been initialized. This code checks the map for a specific key.

...