Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!aplcen!haven!udel!princeton!phoenix!eliot From: eliot@phoenix.Princeton.EDU (Eliot Handelman) Newsgroups: comp.lang.lisp Subject: Re: novice question Message-ID: <3320@idunno.Princeton.EDU> Date: 13 Oct 90 07:11:31 GMT References: <90285.160549JEFHC@CUNYVM.BITNET> Sender: news@idunno.Princeton.EDU Organization: Shitson University, New Crapsey Lines: 21 In article raja@copper.ucs.indiana.edu (Raja Sooriamurthi) writes: ;(defun snoc (l x) (append l (list x))) ; ;Mirror then becomes, ; ;(defun mirror (l) ; (cond ((null l) nil) ; ((listp l) (snoc (mirror (rest l)) ; (mirror (first l)))) ; (t (snoc (mirror (rest l)) (first l))))) ; ;[I might have the syntax mixed up (listp - ?) as I usually program in ;Scheme, but you get the idea I presume] You probably meant: (defun mirror (l) (cond ((null l) nil) ((listp l) (snoc (mirror (rest l)) (mirror (first l)))) (t l)))