Re: [poll] all element reference
- Posted by Jason Gade <jaygade at ya?oo.com> Aug 21, 2007
- 483 views
Salix wrote: > > Hello, > > I'd like to test an idea that could be useful in some cases. > > Would it be a great amount of work to introduce * in the > sequence referencing? I would also appreciate "high level" > comments whether it breaks the logic of the language in > any ways... > > }}} <eucode> > constant x={ > {"John",1}, > {"Mary",5}, > {"Andy",2}, > {"Suse",7}, > {"Jack",5}} > > -- following line would print {1,5,2,7,5} > ? x[*][2] > </eucode> {{{ > > For me the major advantage would be in cases like this: > > }}} <eucode> > -- following line would return 4 > ? find(7,x[*][2]) > > -- currently the search should be handled like this > for i=1 to length(x) by 1 do > if x[i][2]=7 then > ? i > exit > end if > end for > </eucode> {{{ > > What do you think? > > Yours, > > Salix This is a hard one to vote on. I agree with it in principle, but "column access" has been discussed here before and hasn't really gone very far. I think the main reason is that it would be very difficult to implement. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j.