[Gambas-user] Some suggestion

Christopher Brian Jack brian at ...1334...
Sun Dec 3 00:24:45 CET 2006


On Sat, 2 Dec 2006, Rob wrote:

> On Saturday 02 December 2006 20:02, jum wrote:
> > 1. Array[].pop can have optional argument, so when we type
> > array.pop(3) then it functioning like array.remove(3) but it
> > returns the removed content.
>
> I can't speak to the other suggestions, but Pop() is really meant
> to emulate stack operations.  I could see having Remove() return
> the value that it removes from the array, though.

maybe add array.pull() perhaps with the normal stack semantics of
returning the element removed (the top element of the stack)?

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.

.=================================================.
|  Christopher BRIAN Jack aka "Gau of the Veldt"  |
+================================================='
| oevna at ...1543...
`=================================================-
Hi Spambots, my email address is sputnik at ...1334...
Hi Humans, my email address uses rot13 cipher




More information about the User mailing list