std-push


Synopsis

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

Description

STD-PUSH is used to put a element onto a stack (a list) as with CONS. 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").

It is the complement to STD-POP.

Example

(std-push 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