This is a read-only archive of lispforum.com. The forum was locked to new users and posts and is preserved here as static HTML from a database snapshot taken on 2019-09-07.

weird lisp loop type operation

2 posts · 1483 views

Why does the function

(defun counter (list)
(if (null list)
0
(+ 1 ( name (cdr list) )
)
)

loop?

I can't quite see how the self-calling of counter works either.

Re: weird lisp loop type operation

Please use code tags for formatting code.

(name ...) is not a standard Common Lisp function. As shown, the counter doesn't loop by itself.