Search code examples
listlispcommon-lisphashtaglispworks

Incomplete output in Lisp's list, # given with list's deepness over four


I'm using Lispworks for a school's project and I'm having a little trouble; the listener gives me an hashtag in output with lists that have an higher than four deepness. Here's an example:

CL-USER 21 : 5 > '(1(2(3(4(a)))))
(1 (2 (3 (4 #))))

Any clue?


Solution

  • See the variable *print-level*.

    CL-USER 1 > '(1(2(3(4(a)))))
    (1 (2 (3 (4 (A)))))
    
    CL-USER 2 > *print-level*
    NIL
    
    CL-USER 3 > (setf *print-level* 3)
    3
    
    CL-USER 4 > '(1(2(3(4(a)))))
    (1 (2 (3 #)))
    

    Common Lisp allows the control of output in various ways. For lists one can specify for example the maximum depth and the maximum length of the output. This is useful if you work with long and complex list structures which would be otherwise creating long output. The drawback is that you can't re-read such abbreviated output later.