Re: removing an element from a sequence



On Mar 4, 4:39 pm, "An[z]elmus" <some...@xxxxxxxxxxxxx> wrote:
Function remove (or delete) eliminate all the occurences of an item in
a sequence.
for example:

(remove #\a "adagio") ----> "dgio"

Let say that I need to remove only one occurence at a time, for
exmple I may need to remove the #\a at index 2 in "adagio" and obtain
as a result "adgio".
In other words, it would be handy to have a function that remove an
element based on its position/index.
I have not yet figured out how to do it properly.

newLISP v.9.3.0 on Win32, execute 'newlisp -h' for more info.

(set 's "adagio")
"adagio"
(nth-set (s 2) "")
"a"
s
"adgio"
.



Relevant Pages

  • Re: [Newbie] removing an element from a sequence
    ... a sequence. ... Let say that I need to remove only one occurence at a time, for exmple ... Thomas A. Russ, USC/Information Sciences Institute ...
    (comp.lang.lisp)
  • Re: [Newbie] removing an element from a sequence
    ... a sequence. ... Let say that I need to remove only one occurence at a time, for exmple I may need to remove the #\a at index 2 in "adagio" and obtain ... 1st European Lisp Symposium ...
    (comp.lang.lisp)
  • Re: limitation to induction on finite bounds
    ... (Occurence Introduction 1) ... sequence is a member -> sequence occurs ... Do you agree or disagree that rule Non-Occurence Introduction 1 ... since for all lengths of the string 0.3333.. ...
    (sci.math)
  • Re: limitation to induction on finite bounds
    ... (Occurence Introduction 1) ... sequence is a member -> sequence occurs ... Do you agree or disagree that rule Non-Occurence Introduction 1 ... since for all lengths of the string 0.3333.. ...
    (sci.logic)
  • RE: Complications with formulas
    ... sheets) and a Summary sheet at the beginning. ... SEQUENCE OF TWO ZEROS ... if value returned is positive then it counts as 1 occurence. ... formula cell will keep counting to the total times it returned a positive ...
    (microsoft.public.excel.misc)