Re: Last Element Notation

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

Al wrote:

<snip>

> Also interesting is:
>
> s={1,2,3,4,5}
>
> s=s[1..2..4..5] --takes 4 arguments
> or
> s=s[1..2,4..5] --comma separation
>
> both of which would make s equal to:
> {1,2,4,5}

>From a logical point of view, the first example IMHO would/should _not_
make s equal to {1,2,4,5}. This is because '..' means 'from..to'.
So '[1..2..4..5]' would mean 'from 1 via 2 via 4 to 5', i.e.
s[1..2..4..5] = s[1..5]  (= s, in this case). smile

The second example, using comma separation, looks consistant with the
Euphoria syntax to me, though. I think this is a very cool idea.

> That would take care of removal too!

Yes, and it does so in an elegant and Euphorian way, IMHO.

Regards,
   Juergen

-- 
The difference between men and boys
is the price of their toys.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu