mirror of
https://github.com/cookiengineer/audacity
synced 2026-01-12 07:35:51 +01:00
Locate and position the current Audacity source code, and clear a variety of old junk out of the way into junk-branches
This commit is contained in:
30
nyquist/printrec.lsp
Normal file
30
nyquist/printrec.lsp
Normal file
@@ -0,0 +1,30 @@
|
||||
; prints recursive list structure
|
||||
|
||||
;(let (seen-list)
|
||||
(setf seenlist nil)
|
||||
(defun seenp (l) (member l seenlist :test 'eq))
|
||||
(defun make-seen (l) (setf seenlist (cons l seenlist)))
|
||||
(defun printrec (l) (printrec-any l) (setf seenlist nil))
|
||||
(defun printrec-any (l)
|
||||
(cond ((atom l) (prin1 l) (princ " "))
|
||||
((seenp l) (princ "<...> "))
|
||||
(t
|
||||
(make-seen l)
|
||||
(princ "(")
|
||||
(printrec-list l)
|
||||
(princ ") ")))
|
||||
nil)
|
||||
(defun printrec-list (l)
|
||||
(printrec-any (car l))
|
||||
(cond ((cdr l)
|
||||
(cond ((seenp (cdr l))
|
||||
(princ "<...> "))
|
||||
((atom (cdr l))
|
||||
(princ ". ")
|
||||
(prin1 (cdr l))
|
||||
(princ " "))
|
||||
(t
|
||||
(make-seen (cdr l))
|
||||
(printrec-list (cdr l))))))
|
||||
nil)
|
||||
; )
|
||||
Reference in New Issue
Block a user