[Gambas-user] Some suggestion

Rob sourceforge-raindog2 at ...94...
Sun Dec 3 10:11:35 CET 2006


On Saturday 02 December 2006 18:24, Christopher Brian Jack wrote:
> stack pulls, by convention, return the top element of the
> stack before moving the stack pointer (postincrementing the
> stack pointer) and pushes, by convention, move the stack
> pointer before storing the data (predecrementing stack
> pointer).  Virtually every CPU (and compsci textbook) out
> there uses these same semantics for stack operations.

The terminology in my CS textbooks all those years ago was "push 
and pop", not "push and pull".  Gambas already has Push() and 
Pop().... jum was just looking for a method of the Array object 
that acted like Push and Pop, but would operate on any element 
of an array, not just the top (last) element.

I personally would like to see equivalents to Shift and Unshift 
(perl functions that behave like Pop and Push but on the bottom 
(first) element of a list rather than the top element,) but the 
Add method combined with a Remove method that returned the value 
it removed would be good enough for me.

Rob




More information about the User mailing list