While writing a function involving dolist i received an error "should be a lambda expression" with the following code:
Code: Select all
(defun removeSortIterative(x l)
(let ((result 0))
(dolist (e l result) (if (equals x e) (setq result (result)) (setq result ((append (list e) result)))))))
I did some research and it seemed as though the error was due to the double parentheses as an open parentheses indicates a function and (append (list e) result) is not a function. Therefore I added a function so my code now reads:
Code: Select all
(defun removeSortIterative(x l)
(let ((result 0))
(dolist (e l result) (if (equals x e) (setq result (result)) (setq result (append (append (list e) result) nil)))))))
I am now, however, receiving an error that reads "input buffered file-stream character". I would appreciate any help on solving this debacle. I am new to lisp and cannot seem to figure out what's going wrong.
Thanks!