Next / Previous / Contents / Shipman's homepage

7.3. can-add-child: Can a given parent have a given child?

This function is a predicate that specifies whether a new child taxon of a given rank can be added to an existing parent taxon. See Section 15.6, “Hier.canParentHaveChild() for the tests for which taxa can occur as children of a given taxon.

nomcompile3
# can-add-child ( hier, parent, childRank ) ==
#   if (parent.rank < child.rank) and
#   (there are no missing required ranks between parent.rank
#   and child.rank) and
#   ((parent has no children) or
#    (childRank == rank of parent's last child)) ->
#     True
#   else -> False