1. Re: A better way then just "$" -- !

I'll post this again since it's now over 24 hours and not appeared:

On Sun, 21 Sep 2003 05:56:43 +0000, Al Getz <Xaxo at aol.com> wrote:

>If there is a number 'before' AND 'after' the $, then
>
>s=3D{1,2,3,4,5,6,7}
>
>s=3Ds[2$6] -- {1,2,6,7} --note the '6' names the element itself here.

Hmm. consider the common expression:

s=3Ds[1..idx-1]&s[idx+1..length(s)]

To represent that in the above notation, you'd need eg:

s[(idx-1)$(idx+1)]

Doesn't really fly, does it?

However, I did get to think what would be the easiest way to express
this common idiom and came up with:

x[not idx]
or
x[not 3..5]

which is a lot neater than
x[1..idx-1]&s[idx+1..length(x)]

or even
x[1..2]&[6..$]

Regards,
Pete

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu