Re: [poll] all element reference

new topic     » goto parent     » topic index » view thread      » older message » newer message

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

A long, inconclusive thread was dealing with [] with exactly the same meaning.
This sort of construct is sorely needed. Try searching for [] in 2003-2004 when
poster is either CChris or Pete Lomax.

CChris

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu