std-pushnew


Synopsis

(std-pushnew <x> '<lst>)

Description

STD-PUSHNEW is used to put a new element into a stack (a list), similar to STD-ADJOIN. 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").

Example

(std-pushnew 0 '(0 1 2 3))   => (0 1 2 3)
(setq stack '(1 2 3))
(std-push 0 'stack)          => (0 1 2 3)
!stack                       => (0 1 2 3)

Arguments

x: any valid lisp expression

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

Return Value

A list.

Side Effects

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

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

Module

(std-require 'STDLIST)

Defined in STDLIST