How can I remove an element from a list? 
Author Message
 How can I remove an element from a list?

It's only removing an element from a list. The list contains integer
numbers.

Thank you very much.



Sat, 22 Jun 2002 03:00:00 GMT  
 How can I remove an element from a list?

Quote:

> It's only removing an element from a list. The list contains integer
> numbers.

Common Lisp has REMOVE, REMOVE-IF, etc. You should be able to do
(the following is with Allegro CL):

USER(5): x  
(10 11 12 13 14 15)
USER(6): (remove-if #'oddp x)
(10 12 14)
USER(7): (remove 13 x)
(10 11 12 14 15)

Does it help?

--

"... We work by wit, and not by witchcraft;
 And wit depends on dilatory time." - W. Shakespeare.



Mon, 24 Jun 2002 03:00:00 GMT  
 How can I remove an element from a list?

Quote:

> > It's only removing an element from a list. The list contains integer
> > numbers.

> Common Lisp has REMOVE, REMOVE-IF, etc. You should be able to do
> (the following is with Allegro CL):

...and if you don't remember the name:

(apropos :remove :common-lisp)

--
  (espen ;-)



Mon, 24 Jun 2002 03:00:00 GMT  
 How can I remove an element from a list?
Thank you very much for your answers, Oleg and Espen.

I'm using the Apterix Lisp 1.04 (an interpreter) and the remove command
works fine!
I can't say the same for remove-if but what I needed was a remove function.

Thanks again.

Espen Vestre escribi en mensaje ...

Quote:

>> > It's only removing an element from a list. The list contains integer
>> > numbers.

>> Common Lisp has REMOVE, REMOVE-IF, etc. You should be able to do
>> (the following is with Allegro CL):

>...and if you don't remember the name:

>(apropos :remove :common-lisp)

>--
>  (espen ;-)



Fri, 28 Jun 2002 03:00:00 GMT  
 How can I remove an element from a list?
On EmacsLisp I can do this:

(setq l (list ?a ?b ?c))
=>(97 98 99)
(setq l (delq ?a l))
=>(98 99)



Quote:
> Thank you very much for your answers, Oleg and Espen.

> I'm using the Apterix Lisp 1.04 (an interpreter) and the remove
command
> works fine!
> I can't say the same for remove-if but what I needed was a remove
function.

> Thanks again.

> Espen Vestre escribi en mensaje ...

> >> > It's only removing an element from a list. The list contains
integer
> >> > numbers.

> >> Common Lisp has REMOVE, REMOVE-IF, etc. You should be able to do
> >> (the following is with Allegro CL):

> >...and if you don't remember the name:

> >(apropos :remove :common-lisp)

> >--
> >  (espen ;-)

Sent via Deja.com http://www.deja.com/
Before you buy.


Sat, 29 Jun 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. newbie : removing recurring element from lists

2. removing the ' from list elements

3. how to remove certain elements from a list

4. Removing elements from a list while iterating...

5. How to remove one element from a list

6. How do I remove empty elements from a list

7. confused about adding elements to a list with list.append(otherlist)

8. Deleting list of elements from a list

9. common elements in list of list

10. list -> elements of list

11. remove a list from a list

12. list.pop([i]) and list.remove(x) w/ for loops

 

 
Powered by phpBB® Forum Software