(************************************************************************) (* v * The Coq Proof Assistant / The Coq Development Team *) (* 1 then begin bs.size <- bs.size - 1; let oldpos = bs.pos in decr_pos bs; (* Release the memory at oldpos, by coyping what is at new pos *) bs.stack.(oldpos) <- bs.stack.(bs.pos) end let top bs = if bs.size >= 1 then bs.stack.(bs.pos) else error "Nothing on the stack" let app_push bs f = if bs.size = 0 then error "Nothing on the stack" else push bs (f (bs.stack.(bs.pos))) let app_repl bs f = if bs.size = 0 then error "Nothing on the stack" else bs.stack.(bs.pos) <- f (bs.stack.(bs.pos)) let depth bs = bs.size