Lisp HUG Maillist Archive

TRACE does not work when using APPLY?

Hi,

I don't understand the following behavior of lispworks.
Why there are no trace message when I use APPLY?

  CL-USER 38 > (defun foo () ())
  FOO
  
  CL-USER 39 > (trace foo)
  (FOO)
  
  CL-USER 40 > (foo)
  0 FOO > ...
  0 FOO < ...
    << VALUE-0 : NIL
  NIL                       ; This is ok
  
  CL-USER 41 > (apply #'foo nil)
  NIL                       ; Why there's no message?

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: TRACE does not work when using APPLY?

Hi!

This is explained in 5.6.2.2 of the LW Reference Manual: TRACE works
on function names, not on function objects.  They also provide a
workaround there.

Cheers,
Edi.



On Thu, May 29, 2014 at 9:12 AM, KURODA Hisao <kuroda@msi.co.jp> wrote:
>
> Hi,
>
> I don't understand the following behavior of lispworks.
> Why there are no trace message when I use APPLY?
>
>   CL-USER 38 > (defun foo () ())
>   FOO
>
>   CL-USER 39 > (trace foo)
>   (FOO)
>
>   CL-USER 40 > (foo)
>   0 FOO > ...
>   0 FOO < ...
>     << VALUE-0 : NIL
>   NIL                       ; This is ok
>
>   CL-USER 41 > (apply #'foo nil)
>   NIL                       ; Why there's no message?
>
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> lisp-hug@lispworks.com
> http://www.lispworks.com/support/lisp-hug.html
>

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: TRACE does not work when using APPLY?

Thank you!
But this should be fixed?
I feel no one happy with this feature :-)

Edi Weitz <edi@agharta.de> writes:

> Hi!
>
> This is explained in 5.6.2.2 of the LW Reference Manual: TRACE works
> on function names, not on function objects.  They also provide a
> workaround there.
>
> Cheers,
> Edi.
>
>
>
> On Thu, May 29, 2014 at 9:12 AM, KURODA Hisao <kuroda@msi.co.jp> wrote:
>>
>> Hi,
>>
>> I don't understand the following behavior of lispworks.
>> Why there are no trace message when I use APPLY?
>>
>>   CL-USER 38 > (defun foo () ())
>>   FOO
>>
>>   CL-USER 39 > (trace foo)
>>   (FOO)
>>
>>   CL-USER 40 > (foo)
>>   0 FOO > ...
>>   0 FOO < ...
>>     << VALUE-0 : NIL
>>   NIL                       ; This is ok
>>
>>   CL-USER 41 > (apply #'foo nil)
>>   NIL                       ; Why there's no message?
>>
>> _______________________________________________
>> Lisp Hug - the mailing list for LispWorks users
>> lisp-hug@lispworks.com
>> http://www.lispworks.com/support/lisp-hug.html
>>

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: TRACE does not work when using APPLY?

KURODA Hisao <kuroda@msi.co.jp> writes:
>> On Thu, May 29, 2014 at 9:12 AM, KURODA Hisao <kuroda@msi.co.jp> wrote:
>>>
>>> Hi,
>>>
>>> I don't understand the following behavior of lispworks.
>>> Why there are no trace message when I use APPLY?
>>>
>>>   CL-USER 38 > (defun foo () ())
>>>   FOO
>>>
>>>   CL-USER 39 > (trace foo)
>>>   (FOO)
>>>
>>>   CL-USER 40 > (foo)
>>>   0 FOO > ...
>>>   0 FOO < ...
>>>     << VALUE-0 : NIL
>>>   NIL                       ; This is ok
>>>
>>>   CL-USER 41 > (apply #'foo nil)
>>>   NIL                       ; Why there's no message?
>>>
> Edi Weitz <edi@agharta.de> writes:
>
>> Hi!
>>
>> This is explained in 5.6.2.2 of the LW Reference Manual: TRACE works
>> on function names, not on function objects.  They also provide a
>> workaround there.
>
> Thank you!
> But this should be fixed?
> I feel no one happy with this feature :-)


You could use cl-stepper.

cl-user> (ql:quickload :com.informatimago.common-lisp.lisp.stepper)
To load "com.informatimago.common-lisp.lisp.stepper":
  Load 1 ASDF system:
    com.informatimago.common-lisp.lisp.stepper
; Loading "com.informatimago.common-lisp.lisp.stepper"
...
(:com.informatimago.common-lisp.lisp.stepper)
cl-user> (defpackage :example (:use :cl-stepper))
#<Package "EXAMPLE">
cl-user> (in-package :example)
#<Package "EXAMPLE">
example> (defun foo () nil)
foo
example> (step (foo) :trace)
(Will evaluate (foo)
 (Entering function foo
  Exiting  function foo returned one result ==> nil)
 Evaluation of (foo) returned one result ==> nil)
nil
example> (step (apply (function foo) '()) :trace)

(Will evaluate (apply (function foo) 'nil)
  ((function foo) ==> #<Compiled-function foo #x3020029DBAEF>)
 ((function foo) ==> #<Compiled-function foo #x3020029DBAEF>)
 (Entering function foo
  Exiting  function foo returned one result ==> nil)
 Evaluation of (apply (function foo) 'nil) returned one result ==> nil)
nil
example> 


-- 
__Pascal Bourguignon__
http://www.informatimago.com/
"Le mercure monte ?  C'est le moment d'acheter !"

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Updated at: 2020-12-10 08:33 UTC