I am trying to search a file containing lisp code for the number of elements in the list. If anyone knows or has a suggestion on how to get the car (i.e the first element in the list) out of the CString object i have, and how to get the cdr (i.e the rest of the stuff in the list), it would be greatly appreciated. I was wondeing if anoyone knows of any classes that use scheme/lisp that I could take a look at to approach this. Or if there is an easier way of extracting it out in C++ then that would be great to.
Here is an example of what i need to do. (This is a very basic list compared to what im lookin at but its a good example):
(1 2 3 (4 5))
car = 1
cdr = (2 3 (4 5))
car of cdr (ie cadr) = 2
cdr of cdr (ie cddr) = (3 (4 5))
caddr = 3
cdddr = ((4 5))
cadddr = (4 5)
cddddr = ()
Here is an example of what i need to do. (This is a very basic list compared to what im lookin at but its a good example):
(1 2 3 (4 5))
car = 1
cdr = (2 3 (4 5))
car of cdr (ie cadr) = 2
cdr of cdr (ie cddr) = (3 (4 5))
caddr = 3
cdddr = ((4 5))
cadddr = (4 5)
cddddr = ()