concept-traversal.tex 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. % -*- Mode: TeX -*-
  2. % Traversal Rules and Side Effects
  3. \issue{MAPPING-DESTRUCTIVE-INTERACTION:EXPLICITLY-VAGUE}
  4. The consequences are undefined
  5. % (but in general no error will be signaled)
  6. when \term{code} executed during an \term{object-traversing} operation
  7. %!!! Barmar wants them listed.
  8. destructively modifies the \term{object} in a way that might affect the
  9. ongoing traversal operation.
  10. In particular, the following rules apply.
  11. \beginlist
  12. \itemitem{\b{List traversal}}
  13. For \term{list} traversal operations, the \term{cdr} chain of the
  14. \term{list} is not allowed to be destructively modified.
  15. \itemitem{\b{Array traversal}}
  16. For \term{array} traversal operations, the \term{array} is not allowed
  17. to be adjusted and its \term{fill pointer}, if any, is not allowed to
  18. be changed.
  19. \itemitem{\b{Hash-table traversal}}
  20. For \term{hash table} traversal operations, new elements may not be added
  21. or deleted except that the element corresponding to the current hash key
  22. may be changed or removed.
  23. \itemitem{\b{Package traversal}}
  24. %KMP: Isn't this already said in general for object-traversal elsewhere?
  25. %Barmar: Loop?
  26. %KMP: With-package-iterator?
  27. %RPG: Leave it here.
  28. For \term{package} traversal operations (\eg \macref{do-symbols}),
  29. new \term{symbols} may not be \term{interned} in or \term{uninterned}
  30. from the \term{package} being traversed
  31. or any \term{package} that it uses except that the
  32. current \term{symbol} may be \term{uninterned} from the \term{package}
  33. being traversed.
  34. \endlist
  35. %These rules only apply to
  36. %\term{object} manipulators that are not inherently
  37. % destructive.
  38. \endissue{MAPPING-DESTRUCTIVE-INTERACTION:EXPLICITLY-VAGUE}