-
Notifications
You must be signed in to change notification settings - Fork 2
Stack
Hyomoto edited this page Jun 24, 2021
·
2 revisions
| Jump To | Go Back |
Methods | Variables |
|---|
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.
| Jump To | top |
push | pop | top | is_empty | size | toString |
|---|
Returns: self
| Name | Type | Purpose |
|---|---|---|
| values... | mixed |
Values to push |
Adds the values in order to the top of the stack.
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.
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.
Returns: bool
| Name | Type | Purpose |
|---|---|---|
| None |
Returns true if the stack is empty.
Returns: int
| Name | Type | Purpose |
|---|---|---|
| None |
Returns the size of the stack.
| Name | Type | Purpose |
|---|---|---|
| None |
Returns the contents of the stack as a string
| 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 |
Devon Mullane 2020