Re: Feature for next Eu
- Posted by Roderick Jackson <rjackson at CSIWEB.COM> Nov 12, 1999
- 516 views
Boehme, Gabriel wrote: >> The 'remove' function. >> >>Basically, it would work like so... >> >> x = {1,2,3,4,5} .> >> x = remove (x,3) -- x is now {1,2,4,5} > >I would suggest calling it "delete" instead, to pair with your "insert" >idea. > >Also, the "3" in this function is referring to what -- the index, or the >sequence contents? I would assume it's the index, paralleling this with >"insert", but I just want to be clear on what you're proposing... My mistake; the second parameter would indeed be the index, not the value. >> insert (s,x,3) --> s[1..2] & x & s[3..length(s)] > >Bad parm order -- if you're going to have "delete(s,3)" (or "remove(s,3)", >whatever), you should have the index parm in the same location for the >paired routines. "insert(s,3,x)" would be more consistent, IMO. Well, either way wouldn't bother me... >> last (s,5) --> the last 5 elements of s > >?? I guess I don't see much need for this, although I admit it's kind of a >pain to have to code s[length(s)-4..length(s)] instead. I guess I've never >run into a situation where I've needed anything like this... I've got something planned that could benefit from it; but you're right, it's probably not something one would see very often. Probably better left alone. Rod Jackson