Function: avl-tree-stack-pop

avl-tree-stack-pop is a byte-compiled function defined in avl-tree.el.gz.

Signature

(avl-tree-stack-pop AVL-TREE-STACK &optional NILFLAG)

Documentation

Pop the first element from AVL-TREE-STACK.

(See also avl-tree-stack).

Returns nil if the stack is empty, or NILFLAG if specified.
(The latter allows an empty stack to be distinguished from
a null element stored in the AVL tree.)

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/avl-tree.el.gz
(defun avl-tree-stack-pop (avl-tree-stack &optional nilflag)
  "Pop the first element from AVL-TREE-STACK.
\(See also `avl-tree-stack').

Returns nil if the stack is empty, or NILFLAG if specified.
\(The latter allows an empty stack to be distinguished from
a null element stored in the AVL tree.)"
  (let (node next)
    (if (not (setq node (pop (avl-tree--stack-store avl-tree-stack))))
	nilflag
      (when (setq next
		  (avl-tree--node-branch
		   node
		   (if (avl-tree--stack-reverse avl-tree-stack) 0 1)))
	(push next (avl-tree--stack-store avl-tree-stack))
	(avl-tree--stack-repopulate avl-tree-stack))
      (avl-tree--node-data node))))