From ... Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!uio.no!news-feed.ifi.uio.no!ifi.uio.no!not-for-mail From: Erik Naggum Newsgroups: comp.lang.lisp Subject: Re: Why learn Lisp Date: 28 Aug 2002 01:49:03 +0000 Organization: Naggum Software, Oslo, Norway Lines: 26 Message-ID: <3239488143669200@naggum.no> References: <7b8f89d6.0208251650.debf5d6@posting.google.com> <3d6a062d.172584433@newsvr> <3d6b57e0.259035583@newsvr> <3d6becc5$1@nntphost.cis.strath.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: maud.ifi.uio.no 1030499344 29971 129.240.64.16 (28 Aug 2002 01:49:04 GMT) X-Complaints-To: abuse@ifi.uio.no NNTP-Posting-Date: 28 Aug 2002 01:49:04 GMT Mail-Copies-To: never User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.lisp:38973 * Thomas Stegen CES2000 | One "problem" is that recursion is often used and I do not have that much | training in reading recursive functions. But my guess is that this is a | trivial problem which will disappear with time :) Heh. Probably not. Recursion can be extremely hard to understand if you look too closely at it. E.g., the simple factorial function is hard to read if you try to think about what actually happens to 10! and you try to work out the recursive calls in your head. What you need to do with recursive functions is figure out the problem as composed of sub-problems that are just like itself. For instance, an iterative tree traversal function will do a lot of work to remember past nodes, while a recursive version can work on a single node at a time and completely hide the fact that the call stack holds all the information that the iterative version would have to allocate explicit memory to hold. So-called tail-recursive problems are only simple decompositions into itself without any new information in each step and it makes little sense to use this idiom even when you want to train yourself to think recursively, because the whole point with recursive functions is that the call stack contains useful information and tail-recursive functions only use the function call paradigm to express iteration. -- Erik Naggum, Oslo, Norway Act from reason, and failure makes you rethink and study harder. Act from faith, and failure makes you blame someone and push harder.