Category Weenie Discussion

[Discussion moved from CategoryWeenie]

Common Lisp actually encourages iteration heavily. Probably has the most iterative construct known to man. This is one reason why Scheme should not represent Common Lisp for looking vaguely similar, just as flames begin when Java and C are considered essentially the same language.

I was at a Lisp/Scheme conference. People were polled on what kinds of iteration/recursion constructs they used. Common Lispers were represented heavily there, and almost everyone raised their hands when "loop" was mentioned, which is the ultimate iteration framework to end all iterations. When asked about those recursive tail-calls, only two raised their hands - I was one of them. The lesson isn't that lisp is one-or-the-other, but rather it's a multi-paradigm language which accommodates both.

-- Tayssir John Gabbour

Wait a minute. How can you program in Common Lisp without ever using tail recursion? Were these people originally COBOL programmers? Avoiding tail recursion in Lisp is harder than using it.

Or recursion in general. Unlike SchemeLanguage, a CommonLisp implementation is not required to do TailCallOptimization; thus it might be useful in some circumstances to rewrite tail-recursive functions as iterative ones, so it can run in guaranteed bounded space.

If they were ex-Cobol programmers, they'd be better off in Scheme, where they can use continuations to act like gotos. :)


CategoryWeenie


EditText of this page (last edited July 2, 2005) or FindPage with title or text search