std-pop


Synopsis

(std-pop '<lst>)

Description

STD-POP is used to pop a element from a stack. The stack may be defined as list or as symbol (a quoted list) which means that the value of the symbol is set to the return value ("destructive"). The stack is changed then as side-effect. If the stack is defined as list, it will not be changed.

It returns the first element of the stack (a list).

It is the complement to STD-PUSH.

Examples

(std-pop '(1 2 3))     => 1
(setq stack '(1 2 3))
(std-pop 'stack)       => 1
!stack                 => (2 3)

Arguments

lst: a list or a quoted symbol, which evaluates to a list.

Return Value

The first element of the list.

Side Effects

This function may be called only because of its side effect.

It may change the value of the argument, if it is a symbol.

Module

(std-require 'STDLIST)

Defined in STDLIST