%mathpiper,def="PopFront"

Function("PopFront",{stack}) Pop(stack,1);

%/mathpiper



%mathpiper_docs,name="PopFront",categories="User Functions;Lists (Operations)"
*CMD PopFront --- remove an element from the top of a stack
*STD
*CALL
	PopFront(stack)

*PARMS

{stack} -- a list (which serves as the stack container)

*DESC

This is part of a simple implementation of a stack, internally
represented as a list. This command removes the element on the top of
the stack and returns it. This is the last element that is pushed onto
the stack.

*E.G.

In> stack := {};
Result: {};
In> Push(stack, x);
Result: {x};
In> Push(stack, x2);
Result: {x2,x};
In> Push(stack, x3);
Result: {x3,x2,x};
In> PopFront(stack);
Result: x3;
In> stack;
Result: {x2,x};

*SEE Push, Pop, PopBack
%/mathpiper_docs