Re: Dynamic Sequences

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

> I understand how you can add strings to the beginning or end of
> sequences, but how can you delete a value from a sequence?
> i.e. foo = {12, 13, 14, 15} after command foo = {12, 14, 15}. I know
> I could probably write a routine to copy the whole sequence except
> for the unwanted value, but is there an easier way to do this?

Yes, there IS an easy way to do this:
Suppose you have a sequence called S, and want to delete element N:

S = S[1..N - 1] & S[N + 1..length(S)]

You could also make a function called remove() or something to do
this.

Hope this helps.

Michael Bolin

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

Search



Quick Links

User menu

Not signed in.

Misc Menu