Skip to main content

Module order

Module order 

Source
Expand description

Standard order of terms (ISO 8.4.2).

Order: Var < Number < Atom < Compound

  • vars among themselves by heap-cell index
  • numbers by value; Float < Integer when numerically equal; NaN last
  • atoms alphabetically by name
  • compounds by arity, then functor name, then args left-to-right

A LST cell IS the compound '.'(Head, Tail) — arity 2, functor “.”. We treat it as such so a LST and a STR with functor “.” / arity 2 compare structurally equal.

Functions§

compare_terms
Total standard order over two heap words (after dereferencing).