Lisp beginner.
I am trying to add an element to a list inside a function.
(defun add-element (e lst)
(setf lst (cons e lst)))
I cannot use the return of the function to change the original list but my list never gets updated.
CL-USER\> \*assertions\* ((A B) (C D) (E F)) CL-USER\> (add-element '(g h) \*assertions\*) ((G H) (A B) (C D) (E F)) CL-USER\> \*assertions\* ((A B) (C D) (E F))
Is there a way to do this?