How to find the position of an atom in the list. for eg
(position-in-list 'a (a b c d e))
-> 0
(position-in-list 'b (a b c d e) )
-> 1
(position-in-list 'Z(a b c d e) )
->nil.
How to find the position of atom in the list
Re: How to find the position of atom in the list
I replied in your previous thread with a working position-in-list function. However, Common Lisp provides a standard position function which will meet your needs. In you case, you can call it by:
Code: Select all
(position 'a '(a b c d e))
-> 0
(position 'f '(a b c d e))
-> NIL