pike.git / lib / modules / Array.pmod

version» Context lines:

pike.git/lib/modules/Array.pmod:776:   //! @example   //! Array.pop(({ "a", "b", "c", "d" }));   //! > ({ "d", ({ "a", "b", "c" }) })   //! @seealso   //! @[ADT.Stack], @[ADT.Stack.pop], @[ADT.Stack.quick_pop]   array pop(array list) {    if (sizeof(list) == 1)    return ({ list[0], ({}) });    else if (sizeof(list) > 1) {    mixed elem = list[sizeof(list)-1]; -  list = list[0..sizeof(list)-2]; +  list = list[..<1];    return ({ elem, list });    }   }      //! Shifts the first value of the array off and returns it, shortening   //! the array by 1 and moving everything down. If there are no elements   //! in the array it returns 0.   //! Returns an array where the first element is the shifted value and the   //! second element is the modified array.   //! @example