Hi,

I posted this message to comp.lang.lisp, and was advised that this is a bug/issue that the abcl developers need to be aware of. The Usenet link is:

http://groups.google.com/group/comp.lang.lisp/browse_thread/thread/c7406248b7f196a5/951c438878f5e827#951c438878f5e827

And the issue is:

This function generates a list of numbers:

(defun generate-list (len &optional (counter 1))
    "Generate-list returns a list of length len: (1 2 3 ... n)."
    (if (= len counter)
      (list counter)
      (cons counter (generate-list len (1+ counter)))))

All pretty simple. Now if I use this with 15 as the argument in CLisp I get this result:

[4]> (generate-list 15)
(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)

But if I do the same in abcl I get this:

CL-USER(10): (generate-list 15)
(1 2 3 4 5 6 7 8 9 10 ...)

The advice from Frank Buss on that list is:


Take a look at the source code. Looks like in classes/armedbaer/lisp/top-level.lisp in the repl function there is a local binding (*print-length* 10), so setting your own *print-length*, like
suggested by Tamas, doesn't work. But if you take a look at print.lisp, you can see that you can try this:

(setf *print-readably* t)

Now it works. I don't know, if this is compliant to Common Lisp, maybe it is not defined, how the REPL should behave, but in SBCL and LispWorks it doesn't work the same. I think this could be considered a bug in ABCL, because I would expect, that my own print-length settings takes precedence over any internal setting.

Please see the original Usenet post for details and context.





Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU