Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scheme/Lisp in VC++

Status
Not open for further replies.

One2b

Programmer
May 29, 2003
14
US
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 = ()
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top