Your IP : 216.73.216.48
# $EPIC: pop,v 1.4 2003/07/05 06:34:00 jnelson Exp $
Synopsis:
$pop(<variable name>)
$pop(<word list>)
Technical:
* If no arguments are provided, the empty string is returned.
* If the argument consists of only one word, it is taken as <variable name>.
* If more than one arguments are provided, they are taken as <word list>.
* If a <word list> is provided, the return value is the last word in
<word list>. DOUBLE QUOTED WORDS ARE NOT SUPPORTED. (This may change
in the future.)
* If <variable name> is provided, <variable name> is changed by removing
the last word, and the return value is the word that was removed. DOUBLE
QUOTED WORDS ARE NOT SUPPORTED. (This may change in the future.)
* If <variable name> contains only one word, the entire contents of
$<variable name> are returned and the <variable name> variable
is removed/unset.
* This function does not support double-quoted words.
Practical:
Pop removes the last word from a word list, or from a word list stored
in a variable. It reverses the action of push. If you are
implementing a FIFO, you can unshift words onto the front of a
variable and pop them off the back.
Returns:
The last word of <word list> or of $<variable name>.
Examples:
$pop(one two three) returns "three"
assign booya one two three four
$pop(booya) returns "four",
$booya is now "one two three".
History:
This function first appeared in "+7" (post-ircII, pre-EPIC)
See Also:
push(6); shift(6); unshift(6)