Re: Possible feature for new Euphoria-version

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

What exactly do you mean?

In the second example;

sequence seq
seq = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}
integer a
a = seq[ {2, 2} ]

to me it reads, "an embeded sequence", eg 'variable a' returns {{2,2}},
where example 1,  'a' would return
'integer 5'.

n.b. You can do what was done in your example by doing the following,

sequence seq, b, a
seq = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}
b = [2][ 2]
a = b





----- Original Message ----- 
From: "Tommy Carlier" <tommy.carlier at pandora.be>
To: "Euphoria Mailing List" <EUforum at topica.com>
Sent: Friday, January 09, 2004 5:54 AM
Subject: Possible feature for new Euphoria-version


>
>
> Sequences are really easy to use, but there is no way you can create an
> index to a sub-, sub-, sub-sequence of a given sequence. Wouldn't it be
> nice if such a thing existed?
>
> In the current version of Euphoria, you can do:
> sequence seq
> seq = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}
> integer a
> a = seq[2][2]
>
> My suggestion for a new feature: allow the index to be a sequence. That
> way you could do something like this:
> sequence seq
> seq = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}
> integer a
> a = seq[ {2, 2} ]
>
> And now for the exciting part:
> sequence seq
> seq = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}
> sequence b
> b = {2, 2}
> integer a
> a = seq[b]
>
> This way you can also pass and return multiple indices to and from
> procedures and functions.
>
> -- 
>
> Tommy Carlier
> tommy online: http://users.pandora.be/tommycarlier
>
>
>
> TOPICA - Start your own email discussion group. FREE!
>
>
> -- 
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.558 / Virus Database: 350 - Release Date: 4/01/04
>


---



--

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

Search



Quick Links

User menu

Not signed in.

Misc Menu