Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!think.com!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!sics.se!ifi!nuug!ulrik!rolfl From: rolfl@hedda.uio.no (Rolf Lindgren) Newsgroups: comp.lang.lisp.franz Subject: Re: Lisp Macros Message-ID: Date: 16 May 91 08:29:39 GMT References: <1991May15.203735.3850@csusac.csus.edu> Sender: news@ulrik.uio.no (Mr News) Organization: University of Oslo, Norway Lines: 25 In-Reply-To: cs16011@athena.ecs.csus.edu's message of 15 May 91 20:37:35 GMT Nntp-Posting-Host: hedda.uio.no In article <1991May15.203735.3850@csusac.csus.edu> cs16011@athena.ecs.csus.edu writes: Hello, I have got an exam question in my Franz Lisp class about whether macros can be recursive or not. I have check my textbook and Franz Lisp Interpreter's online manual here on campus but found no mentioning about whether this is possible or not. If macros can be recursive, can anyone please give me an example for supporting the claim? A macro is, at some time, expanded. It's just a template for a function, an idea, not a function per se. Now recursivity demands that one at some time prior to application of the function need not know how many times the function will call itself. A macro must know that. Hence, a macro can only be tail-recursive (i. e. an implied for). Macros in TeX, as an example, are not recursive. Now if the macro could calculate its number of expansions during calculation, there still would have to be an effective algorithm that could do that _prior_ to expansion. Some of my assumptions here are ...loose... I eagerly await being corrected. Rolf Lindgren | "The opinions expressed above are 616 Bjerke Studentheim | not necessarily those of anyone" N-0589 OSLO 5 | rolfl@hedda.uio.no