Branch: Tag:

2005-12-13

2005-12-13 23:34:51 by Martin Nilsson <mani@lysator.liu.se>

Stack is now castable to array

Rev: lib/modules/ADT.pmod/Stack.pike:1.11

1:   #pike __REAL_VERSION__    - // $Id: Stack.pike,v 1.10 2003/08/22 14:23:13 nilsson Exp $ + // $Id: Stack.pike,v 1.11 2005/12/13 23:34:51 nilsson Exp $      //! This class implements a simple stack. Instead of adding and removing   //! elements to an array, and thus making it vary in size for every push
130:    return ns;   }    + mixed cast(string to) { +  switch(to) { +  case "array": +  return _values(); +  default: +  error("Cannot cast to %s.\n", to); +  } + } +    string _sprintf(int t) {    return t=='O' && sprintf("%O%O", this_program, _values());   }