Skip to content

Instantly share code, notes, and snippets.

@NSCoder
Created June 23, 2022 15:29
Show Gist options
  • Save NSCoder/cf40ed2dbf081fdf2a64ab29138c838f to your computer and use it in GitHub Desktop.
Save NSCoder/cf40ed2dbf081fdf2a64ab29138c838f to your computer and use it in GitHub Desktop.
Use recursion to print all elements from a list in emacs lisp
(defun ns/print-list (list)
(when list
(print (car list))
(print-list (cdr list))))
(setq coffe-types '(cortado macchiato dopio))
(ns/print-list coffe-types)
;; Output
;; cortado
;; macchiato
;; dopio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment