I'm making a function in scheme(lisp) in which I need to cons a list with it reverse, as below:
(cons list (cdr (reverse list)))
consider I have this list '(0 1 2), the desired output would be:
(0 1 2 1 0)
but I get:
((0 1 2) 1 0)
is there any function that returns the values of the list, not the list itself?