Skip to content
Hyomoto edited this page Jun 24, 2021 · 2 revisions
Jump To Go Back Methods Variables

Stack( )

Implements: Struct

Am alternative to the built-in stack. It makes use of a simple linked list to provide a fast, cheap, garbage-collected stack.

Methods

Jump To top push pop top is_empty size toString

push( values... )

Returns: self

Name Type Purpose
values... mixed Values to push

Adds the values in order to the top of the stack.


pop( )

Returns: mixed or EOS

Name Type Purpose
None

Pops the value off the top of the stack and returns it. If the stack is empty, EOS is returned instead.


top( )

Returns: mixed or EOS

Name Type Purpose
None

Peeks at the top value of the stack and returns it. If the stack is empty, EOS is returned instead.


is_empty( )

Returns: bool

Name Type Purpose
None

Returns true if the stack is empty.


size( )

Returns: int

Name Type Purpose
None

Returns the size of the stack.


toString( )

Name Type Purpose
None

Returns the contents of the stack as a string


Variables

Jump To top
Name Type Initial Purpose
pool undef new ObjectPool() No description.
EOS [strict](strict) {} A value that is returned when the stack is empty
__Stack struct undefined A pointer to the next node in the stack
__Size int 0 The number of nodes in the stack
Clone this wiki locally