SLOOP -> ANSI LOOP translation



Hi Ole.

| It would be interesting to know what implementations return for the
| following:
| 
| (defun nleft (n x &optional tail)
|   (loop for v on (nthcdr n x)
|         for w on x
|         when (eq v tail) do (return w)
|         finally (return w)))
| 
| (nleft 1 '(0 1))
| 
| SLOOP says '(1), while MIT LOOP says '(0 1). I had assumed MIT LOOP is
| correct but I haven't checked.



I got (0 1) on all of the following:

  GCL 2.6.5, Corman Lisp 2.5 and LispWorks Personal 4.3.6


With CLISP 2.30 There was an error:

[1]> (defun nleft (n x &optional tail)
  (loop for v on (nthcdr n x)
        for w on x
        when (eq v tail) do (return w)
        finally (return w)))
NLEFT

[2]> (nleft 1 '(0 1))

*** - EVAL: variable W has no value
1. Break [3]>

All tests on WIndows.

Cheers

Mike Thomas