Pergunta

I declared the following list in lisp:

  (defvar car-owners-2 (list (list 'yaakov (list 'volvo 100000.0)) 
                             (list 'moshe (list 'vw 75000.0)) 
                             (list 'rachel (list 'mazda 60000.0)) 
                             (list 'sarah (list 'volvo 100000.0)) 
                             (list 'david  (list 'renault 50000.0))
                             (list 'leah  (list 'vw 75000.0))))

and when I want to see it from the listener file I get this disgusting output:

 CL-USER 19 : 6 > car-owners-2
    (((QUOTE YAAKOV) (QUOTE (# 100000.0))) ((QUOTE MOSHE) (QUOTE (# 75000.0))) 
    ((QUOTE RACHEL) (QUOTE (# 60000.0)))   ((QUOTE SARAH) (QUOTE (# 100000.0)))
    ((QUOTE DAVID) (QUOTE (# 50000.0)))    ((QUOTE LEAH) (QUOTE (# 75000.0))))

How can I make the output normal? And why instead of names it prints #? I want the output to be like this:

((YAAKOV (VOLVO 100000.0)) (MOSHE (VW 75000.0)) (RACHEL (MAZDA 60000.0))...)

Thanks. I use LispWorks 6.0.1

Foi útil?

Solução

Maybe create the same list this way:

> '((yaakov (volvo 100000.0))
    (moshe (vw 75000.0))
    (rachel (mazda 60000.0))
    (sarah (volvo 100000.0))
    (david (renault 50000.0))
    (leah (vw 75000.0)))

Outras dicas

CL-USER 19 : 6 >

First I would go out of the debugger.

This would be the usual prompt:

CL-USER 19 >

The 19 says that it is the 19th form read. The : 6 above means that you are in a debugger and the 6th form in the debugger is read.

CL-USER 19 : 6 > :top

:top brings you to the top-level.

Then check the value of variables like *print-level* and *print-length*.

CL-USER 12 > (setf *print-level* 2)
2

CL-USER 13 > (list (list 'yaakov (list 'volvo 100000.0)) 
                             (list 'moshe (list 'vw 75000.0)) 
                             (list 'rachel (list 'mazda 60000.0)) 
                             (list 'sarah (list 'volvo 100000.0)) 
                             (list 'david  (list 'renault 50000.0))
                             (list 'leah  (list 'vw 75000.0)))
((YAAKOV #) (MOSHE #) (RACHEL #) (SARAH #) (DAVID #) (LEAH #))

CL-USER 14 > (setf *print-level* nil)
NIL

CL-USER 15 > (list (list 'yaakov (list 'volvo 100000.0)) 
                             (list 'moshe (list 'vw 75000.0)) 
                             (list 'rachel (list 'mazda 60000.0)) 
                             (list 'sarah (list 'volvo 100000.0)) 
                             (list 'david  (list 'renault 50000.0))
                             (list 'leah  (list 'vw 75000.0)))
((YAAKOV (VOLVO 100000.0)) (MOSHE (VW 75000.0))
 (RACHEL (MAZDA 60000.0)) (SARAH (VOLVO 100000.0))
 (DAVID (RENAULT 50000.0)) (LEAH (VW 75000.0)))
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top