Hash tables and arrays are already implemented. The most important missing ones are Multimaps, Sets, Multisets, Linked lists, Deques. It should be quite easy to write c++ wrappers and put them in a component. For example, a Set can use a std::set<GB_VARIANT_VALUE> internally.
Implementing them in Gambas should work, but would be quite slow. I suggest writing them as a component gb.datastructures or something. And yes, Gambas lacks templates, but Variants can be used instead. Not optimal, but it works. /Emil 2012/5/21 Demosthenes Koptsis <demosthen...@gmail.com> > Basic languages have simple data structures like vars and arrays but > other languages > like c++ with the help of pointers can have advanced data structures > like containers etc... > > see a full list here > http://en.wikipedia.org/wiki/List_of_data_structures > > i wonder if such data structures can be implemented with gambas with > pointers and if such an action have any mean for real life > applications? > > Is it possible to have such data structures in gambas? > How about some of these to be part of the core libraries? > > > Abstract data types <http://en.wikipedia.org/wiki/Abstract_data_types > > > > * Container <http://en.wikipedia.org/wiki/Container_%28data_structure%29> > * Map/Associative array/Dictionary > <http://en.wikipedia.org/wiki/Associative_array> > * Multimap <http://en.wikipedia.org/wiki/Multimap> > * List <http://en.wikipedia.org/wiki/List_%28abstract_data_type%29> > * Set <http://en.wikipedia.org/wiki/Set_%28computer_science%29> > * Multiset > <http://en.wikipedia.org/wiki/Set_%28computer_science%29#Multiset> > * Priority queue <http://en.wikipedia.org/wiki/Priority_queue> > * Queue <http://en.wikipedia.org/wiki/Queue_%28data_structure%29> > * Deque <http://en.wikipedia.org/wiki/Deque> > * Stack <http://en.wikipedia.org/wiki/Stack_%28data_structure%29> > * String <http://en.wikipedia.org/wiki/String_%28computer_science%29> > * Tree <http://en.wikipedia.org/wiki/Tree_%28computer_science%29> > * Graph <http://en.wikipedia.org/wiki/Graph_%28data_structure%29> > * Hash <http://en.wikipedia.org/wiki/Hash_Table> > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user