From: ab talebi
Subject: complex iteration
Date: 
Message-ID: <3c4c3220.9349374@news.uio.no>
this iteration is very complex and hard to understand for me maybe
some one else can help me?

I have this list that consists of two (but it can be more) strings

my-list:
(("car ((noun automoblie sks hui)(noun vehicle sks hui)) is ((verb hji
ska) (noun ako hui)) blue ((adj hji hui))" "strong ((adj hji hui) (adv
ly hui)) is ((verb hji ska) (verb kos hji)) man ((noun ako hui) (prop
hui))"))

what I need is this list:
(
((noun noun) (verb noun) (adj))
((adj adv) (verb verb) (noun prop)))

we don't know how many strings we have in my-list but I guess
 (length (car test)) 
can tell us that

(caar my-list) wil give me the first string:
"car ((noun automoblie sks hui)(noun vehicle sks hui)) is ((verb hji
ska) (noun ako hui)) blue ((adj hji hui))"

I have a function called sting-to-list that simply gets a "string" and
turns it to a (list) I use it to get this:

(defun string-to-list (str &optional (pos 0) (list nil))
  (multiple-value-bind (obj newpos)
       (read-from-string str nil :end-of-string :start pos)
    (if (eql obj :end-of-string)
       (nreverse list)
       (string-to-list str newpos (cons obj list)))))

(mapcar #'car (cadr (string-to-list (caar my-list))))
(NOUN NOUN)

but I don't know how to use this information to iterate the list and
get what I need

tnx
ab talebi