I have the following code:
(define rest '(((di (a) (b c)) (sh (b) (e d))) ((al (a) (b)))))
(define first '((di (a) (5)) (sh (b) (3))))
I want to get the following list:
(((di (a) (5)) (sh (b) (3))) ((di (a) (b c)) (sh (b) (e d))) ((al (a) (b)))))
meaning, add the list first, to be the first element in rest.
When I do append, it gives me:
((di (a) (5)) (sh (b) (3)) ((di (a) (b c)) (sh (b) (e d))) ((al (a) (b))))
And any other library function, or function that I try to do, didn’t help.
Thank you.
Appendtakes two lists and puts them together. Given that you have afirstand arest, you probably wantcons.Constakes an element and prepends it to a list. In this case, the element isfirstand the list isrest. So you want something like