Printing list for new buffer

I am making a function that takes a string containing the name of a buffer. In a way that if the buffer does not exist it is created. My plan is to use get-buffer-create because it can take a buffer or the name of a buffer.

My difficulty is that with (print-list animals “Messages”) things can printed in the Messages buffer, but (print-list animals “Pepsi”) ends up with the Pepsi buffer being empty.


(defun print-list (list &optional nmbufr)
  "DESC"

  (with-current-buffer (get-buffer-create nmbufr)

    (princ "- dolist -")   
    (dolist (elm list)
      (princ elm)
      (princ "\n"))

    (princ "- mapconcat -")   
    (princ (mapconcat #'identity list "\n"))))

Ok, so first off, include a test-run that can be duplicated if you want help with a coding issue, Second, why on earth are you doing it in Lisp?