• Re: Depth First Search traversal of this list

    From B. Pym@Nobody447095@here-nor-there.org to comp.lang.lisp,comp.lang.scheme on Fri Aug 30 17:31:59 2024
    From Newsgroup: comp.lang.scheme

    Kenny wrote:

    (defun tv (x)
    (if (consp x)
    (loop for y in x do (tv y))
    (format t "~a " x)))

    Gauche Scheme

    (define (tv x)
    (if (pair? x) (for-each tv x) (format #t "~a " x)))

    (tv '(j k (l m (n o) p) q))


    j k l m n o p q
    --- Synchronet 3.22a-Linux NewsLink 1.2