• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

LISP help?

CTho9305

Elite Member
I'm trying to implement "pos+". It is supposed take a list and return each element plus its position.... (7 5 1 4) becomes (7 6 3 7).

Instead, I'm getting ((((NIL . 7) . 6) . 3) . 7)

I don't want a dotted list. How do I solve that? Right now I'm doing it iteratively. I haven't started worrying about how to do it using recursion or mapcar yet.

Yes, this is a homework problem. Therefore, giving me code would be unethical. 😉 😉.
 
Back
Top