on dolist..
Posted: Fri Oct 12, 2012 6:49 am
HI
I'm very newbie also in programming, and I'm trying to learn CL
ok, I have just a problem with this exercize that ask me : "define a function that takes a list as an argument and returns true if one of its elements is a list.
OK,I just studied dolist, then:
but NIL raise...why? ther's a nested list in list arg for use_dol func... I can't understand why!
thanks in advance for help!
I'm very newbie also in programming, and I'm trying to learn CL

ok, I have just a problem with this exercize that ask me : "define a function that takes a list as an argument and returns true if one of its elements is a list.
OK,I just studied dolist, then:
Code: Select all
(defun use_dol (lst)
(dolist (x lst)
(if (listp x)
t)))
(use_dol '(a b '(c d) e))

thanks in advance for help!