[Gambas-user] About changes in ListView, TreeView & ColumnView

Nelson Ferraz nferraz at ...184...
Sun Dec 14 23:18:57 CET 2003


Benoit Minisini wrote:
>>Another thing, it would be interesting to have the following methods to
>>deal with arrays: Shift, Unshift, Push and Pop.
> 
> Hey... Push() and Pop() already exist !

That's cool! Half way done. :)

> You can do: MyArray.Add(Item) or MyArray.Push(Item) to insert an item at the 
> last position, and MyArray.Add(Item, 0) to insert an item at the first 
> position.

I'd tend to use MyArray.Add(Item,Position) to insert items at arbitrary 
positions.

It would be nice to have Shift and Unshift, if nothing else, to improve 
the symmetry of the language:

              [][][][][] <- Push
              [][][][][] -> Pop
   Shift   <- [][][][][]
   Unshift -> [][][][][]

Of course, it's important to consider the impact, in terms of risk and 
performance, of implementing such functions on regular arrays.

What do you think? It's worth the risk? (Considering Gambas already has 
Push() and Pop()...)

-- 
[]s

Nelson

________________________________________________________________
Nelson Ferraz

GNU BIS: http://www.gnubis.com.br
PhPerl:  http://www.phperl.com






More information about the User mailing list