[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: method tracing



>Bug in untracing methods?
>
>Welcome to Macintosh Common Lisp Version 2.0f2!
>? (defmethod test ((test null)) nil)
>#<STANDARD-METHOD TEST (NULL)>
>? (trace ((:method test (null))))         ; fine
>NIL
>? (test nil)                              ; fine
> Calling ((:METHOD TEST (NULL)) NIL) 
> (:METHOD TEST (NULL)) returned NIL
>NIL
>? (untrace ((:method test (null))))       ; is the syntax ok?
>NIL                                       ; nil?
>? (test nil)                              ; oops?
> Calling ((:METHOD TEST (NULL)) NIL) 
> (:METHOD TEST (NULL)) returned NIL
>NIL
>? (untrace)
>((:METHOD TEST (NULL)))
>? (test nil)
>NIL
>? 

You had one too many levels of parens in the UNTRACE call.
TRACE takes an extra level of parens to allow for specifying :BEFORE,
:AFTER, and :STEP

? (defmethod test ((x null)) nil)
#<STANDARD-METHOD TEST (NULL)>
? (test nil)
NIL
? (trace (:method test (null)))
NIL
? (test nil)
 Calling ((:METHOD TEST (NULL)) NIL) 
 (:METHOD TEST (NULL)) returned NIL
NIL
? (untrace (:method test (null)))
((:METHOD TEST (NULL)))
? (test nil)
NIL
?