User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

push_function [2007/03/23 16:39] (current)
Line 1: Line 1:
 +# $EPIC: push_function.txt,​v 1.4 2007/03/23 16:39:05 jnelson Exp $
 +$__push__(<​variable name> <​data>​)
 +This function appends a word to the end of <​variable name>​. ​ The <​data>​
 +is considered to be **one word**. ​ This means if [[xdebug]] dword is turned
 +on, then the client will add double quotes around <​data>​ before appending
 +it to the variable!
 +You need to turn off [[xdebug]] dword to get the epic4 behavior!
 +Push adds a new word to the end of $<​variable name>, which is considered
 +a variable containing a word list.  It is equivalent to the following:
 +@ <​variable_name>​ #= (<​variable_name>​ ? [ ] : []) ## data
 +This function is useful to append a word to the end of a word list,
 +which you might do to create a FIFO, LIFO, or other ordered queues. ​ The
 +reverse of __push__() is [[pop function|pop]]() and the inverse is
 +[[unshift function|unshift]](),​ while the inverted reverse is [[shift
 +If <​variable name> doesn'​t exist before you __push__() something onto it,
 +then it is created automatically for you.
 +The new value of $<​variable name>.
 +$push(blah hello there) ​           adds "hello there" to end of $blah
 +This function first appeared in "​+7"​ (post-ircII,​ pre-EPIC)
push_function.txt ยท Last modified: 2007/03/23 16:39 (external edit)