From: ··········@yahoo.com
Subject: Unexpected behavior using OpenMCL
Date: 
Message-ID: <1167879925.127180.178390@v33g2000cwv.googlegroups.com>
Hello,

I've got an unexpected behavior in OpenMCL when programming some
examples on recursion for my students. The function skip-first-n
(elimina-primeros-n in spanish), can be defined as:

CL-USER> (defun elimina-primeros-n-rec (n lst)
                         (cond ((zerop n) lst)
	                            (t (elimina-primeros-n-rec (- n 1) (cdr
lst)))))
ELIMINA-PRIMEROS-N-REC
CL-USER> (elimina-primeros-n 3 '(1 2 3 4 5 6))
(1 2 3 4 5 6)

but, as shown, the function is not working as expected! I've tried the
same definition on LispWorks, obtaining:

CL-USER 1 > (defun elimina-primeros-n-rec (n lst)
              (cond ((eq n 0) lst)
                    (t (elimina-primeros-n-rec (- n 1) (cdr lst)))))
CL-USER 2 > (elimina-primeros-n-rec 3 '(1 2 3 4 5 6))
(4 5 6)

Why is OpenMCL behaving in this way?
From: ··········@yahoo.com
Subject: Re: Unexpected behavior using OpenMCL
Date: 
Message-ID: <1167880097.986509.317710@11g2000cwr.googlegroups.com>
Sorry, I was calling the non-recursive definition of my function!
(elimina-primeros-n instead of elimina-primeros-n-rec)