Copy parts of a list into a new list [solved]
Posted: Tue Jun 08, 2010 1:02 pm
Hi everyone,
I'm new on this forum so I hope this question haven't been ask yet. I'm also new to lisp / common lisp this might be a pretty easy question.
I manage to copy an "old-list" into a "new-list". But what I would like to do is to take out some item of the lisp.
For example, if I have
(defparameter *foo* (list "hello" "my" "name" "is "Ethan"))
I would like to take out every work that has an "e" inside it so that my new list would look like ("my" "is").
This is the code that I have to copy to a new list
Thank you in advance for your help
Cajetan
I'm new on this forum so I hope this question haven't been ask yet. I'm also new to lisp / common lisp this might be a pretty easy question.
I manage to copy an "old-list" into a "new-list". But what I would like to do is to take out some item of the lisp.
For example, if I have
(defparameter *foo* (list "hello" "my" "name" "is "Ethan"))
I would like to take out every work that has an "e" inside it so that my new list would look like ("my" "is").
This is the code that I have to copy to a new list
Code: Select all
(defparameter *big-x* (list (list 1 2 3) (list 4 5 6)))
(defun extract-my-history2 ()
(let (new-list)
(dolist (frame *big-x*)
(setf new-list (append new-list (list frame))))
new-list))
(setf b (extract-my-history2))
Cajetan