- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dear sirs, help me solve the following problem.
I need a function that would add an item to a list with nested lists.
The original list might look like this:
'((1 3 5) (1 3 5) (1 3 5))
after that I need to insert at position: (nth 1) element "2", and at position: (nth 2) element 4. Then the transformed list will look like this:
'((1 "2" 3 4 5) (1 "2" 3 4 5) (1 "2" 3 4 5))
The very execution of the function in this case may look like this:
(somefunction '((1 "2") (2 4)))
The first item is a position on the list, starting from zero.
The second item is the value of the added element.
Theoretically, there can be an unlimited number of added elements, but there should be no more than the length of the original list.
Thanks in advance.
Solved! Go to Solution.