Stack overflow from recursive function call in Lisp

后端 未结 4 489
再見小時候
再見小時候 2020-12-31 16:38

I am learning Lisp from the book \"The Land of Lisp\" by Conrad Barski. Now I have hit my first stumbling block, where the author says:

Calling yourse

4条回答
  •  一向
    一向 (楼主)
    2020-12-31 16:51

    (DEFUN nrelem(l) 
        (if (null l)
            0
           (+ (nrelem (rest l)) 1)
    ))
    

提交回复
热议问题