Re: [poll] all element reference
- Posted by CChris <christian.cuvier at ag?ic?lture.gouv.fr> Aug 22, 2007
- 482 views
Salix wrote: > > Juergen Luethje wrote: > > > > <<a > > href="http://www.openeuphoria.org/cgi-bin/esearch.exu?fromMonth=9&fromYear=9&toMonth=9&toYear=9&postedBy=Derek+Parnell&keywords=getColumn">http://www.openeuphoria.org/cgi-bin/esearch.exu?fromMonth=9&fromYear=9&toMonth=9&toYear=9&postedBy=Derek+Parnell&keywords=getColumn</a>> > > > > If you suggest me to write a function for it then I should > agree that it's not a demanding work. On the other hand > [*] seems to be more flexibe and handy. Just try to compare > the number of characters hit for the example below. > > But I think the Patrick Barnes email in the same discussion > should make me thinking. My justification for this feature > was a custom find() situation that I meet regularly. But due > to the memory requirement [*] might not be efficient at all. > > }}} <eucode> > -- some more example > constant x={ > {"John",1,74}, > {"Mary",5}, > {"Andy",2,68}, > {"Suse",7,62}, > {"Jack",5,84}} > > -- following line would print {1,5,2,7,5} > ? x[*][2] > > -- following line would print "oanua" > ? x[*][1][2] > > -- following line would print {'J',1,74} > ? x[1][*][1] > </eucode> {{{ > > Cheers, > > Salix That's the main issue. For it to work right, we'd need to have a "table" native type to denote a set of columns, each of which with its type. It would be organised in memory so that [] or [*] could be done more efficiently than by writing the getColumn() function. btw, thee way out I use more or less often is to organise tables by field, not by record. This means having one sequence per field, and recors are of the form {field_1[i];field_2[i],...}. According to whether you need to access the table one record or one field at a time, this may be a more efficient alternate strategy. CChris