I have a function,format-ls:
(defun format-ls (ls)
(let (( acc ()))
(dolist (elt ls)
(push "(~A . " acc))
acc))
You can notice that there is a missing parenthesis in the closing line, acc)).
Yet my Lisp REPL(sbcl 2.1.1) interprets this expression without any errors:
But if I add the missing parenthesis, as shown below:
(defun format-ls (ls)
(let (( acc ()))
(dolist (elt ls)
(push "(~A . " acc)))
acc))
The REPL throws out the following error:
Now this expression where all the parenthesis are matched, will be interpreted without any issues:
(b)
(defun post+ (ls)
(let (( acc ()))
(let ((i -1))
(dolist (elt ls)
(push (+ elt (setf i(+ i 1))) acc)))
(reverse acc)))
What am I missing here?