June 20, 20241 yr Hello, I'd like to create a palindrome where I start with ((s -) (e -) (3e = = -e)) and have the output be ((s -) (e -) (3e = = -e) (e -) (s -)) . But the gen-palindrome function doesn't quite do this. Is there a general lisp way of doing this?
June 20, 20241 yr This is one way. (setf foo '((s -) (e -) (3e = = -e))) (append foo (cdr (reverse foo))) Or as a function (defun palindrome (lst) (append lst (cdr (reverse lst))) ) (palindrome foo) Jesper
Create an account or sign in to comment