Created
June 23, 2022 15:29
Use recursion to print all elements from a list in emacs lisp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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