Following global procedures are defined:
empties a stack
Params:stack id to clear
removes a stack by its name
Params:name of the stack to remove
stack_remove("tags")
stack_new()
Following global functions are defined:
check if a stack id is valid
Params:stack id to check
integer: 1 if valid or 0 if not
if not stack_check(stack_id) then return 0 end if
pushes an object on the LiFo stack
Params:stack id to push on
object to push on the stack
integer: 1 if successful, 0 if not
void = stack_push(10, "One")
pushes string "One" on stack #10
stack_pop(), stack_at(), stack_last()
gets last element of the stack (most recent one)
Params:stack id to check
object to return if check fails
stack_last does not remove the last item of the stack as stack_pop does
last item if successful or object notFound if not
x = stack_last(stack_id, notFound)
returns last object if stack is not empty and notFound if not
stack_push(), stack_pop(), stack_at()
gets last element of the stack (most recent one)
Params:stack id to pop from
object to return if pop fails
stack_pop removes the last item of the stack whereas stack_last does not
last item if successful or object notFound if not
x = stack_pop(stack_id, notFound)
returns most recent object if stack is not empty and notFound if not
stack_push(), stack_last(), stack_at()
checks item at position i in stack
Params:stack id to check
position of item to check in the stack
object to return if check fails
stack_at does change the content of the stack
item at given position if successful or object notFound if not
x = stack_at(stack_id, 3, notFound)
returns the third most recent object in stack if stack_size is enough
and notFound if not
stack_push(), stack_pop(), stack_last()
returns the stack content as a sequence
Params:stack id to compute the path
sequence
void = stack_push(10, "One")
void = stack_push(10, "Two")
void = stack_push(10, "Three")
puts(1, stack_dump(10)) shows
. [1] "Three"
. [2] "Two"
. [3] "One"
returns the stack content as a string
Params:stack id to compute the path
result is formatted as a POSIX file path
sequence: a string formatted as a POSIX file path
void = stack_push(10, "One")
void = stack_push(10, "Two")
void = stack_push(10, "Three")
puts(1, stack_path(10)) shows "Three/Two/One"
returns stack id corresponding to given stack name
Params:stack name to find
integer: corresponding stack id
return stack size
Params:stack id to check
integer: stack size
creates a new LiFo stack
Params:stack name to associate with new stack id
integer: the new stack id
id = stack_new("tags")
stack_remove()