This is a read-only archive of lispforum.com. The forum was locked to new users and posts and is preserved here as static HTML from a database snapshot taken on 2019-09-07.

How to convert C++ const_iterator and more to Lisp

1 post · 2565 views

How do I convert this section of C++ code into Lisp using Lisp lists. I don't really need to show it but I have a C++ vector<int>
I converted into lisp using CFFI. I converted the vector<int> filled with 5 numbers ,to a Lisp List.

Here is the final Lisp list:

(1 2 3 4 5)

I would like you to hopefully ignore what I said previously and pretend that I'm just starting out with the previously mentioned Lisp list and know I need to operate on it precisely as below so it will fit into the other C++ code I'm converting to Lisp. can you kind gentleman possible show my the exact Lisp equivelant of the below statement, operating on this exact list (1 2 3 4 5). Thanks in advance for any help on this.

for( vector<int>::const_iterator r = number.begin(); r != number.end(); r++ )
{
number.push_back(1);
}