Using trace. 
Author Message
 Using trace.

Hi,

I am experiencing some problems when trying to use trace.  I have a
simple function,

(define (pow num to)
  (if (< to 1)
      1
      (* num (pow num (- to 1)))))

that I want to trace.  I do (in DrScheme):

Quote:
> (require-library "trace.ss")
> (trace pow 5)

macro error: trace: 5 not a name
Quote:
> (define arg 5)
> (trace pow arg)
> (trace pow arg)

trace: the top-level value of arg is not a procedure
Quote:
> (define arg (lambda () 5))
> (trace pow arg)

(pow arg)

which is not what I expected.  How is it done?

Thanks,
  -- john
Today is the first day of the rest of your life.
...
Unless you die today.

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Thu, 17 Apr 2003 03:48:26 GMT  
 Using trace.

Quote:

>> (trace pow 5)
>macro error: trace: 5 not a name
...
>which is not what I expected.  How is it done?

I'm not sure what you're trying to do with that "5". Trace normally
takes only one argument: the name of a procedure to be traced.

Quote:
> (trace pow)
(pow)
> (pow 10 3)

|(pow 10 3)
| (pow 10 2)
| |(pow 10 1)
| | (pow 10 0)
| | 1
| |10
| 100
|1000
1000

--



Thu, 17 Apr 2003 21:34:42 GMT  
 Using trace.
(define pow ...)
(trace pow) ; all invokations of pow will be traced
(pow 5 3) ---> pow is traced.
Jos
--
Jacob J. A. Koot (Jos)
http://home-1.wolmail.nl/~koot


Quote:
> Hi,

> I am experiencing some problems when trying to use trace.  I have a
> simple function,

> (define (pow num to)
>   (if (< to 1)
>       1
>       (* num (pow num (- to 1)))))

> that I want to trace.  I do (in DrScheme):

> > (require-library "trace.ss")
> > (trace pow 5)
> macro error: trace: 5 not a name
> > (define arg 5)
> > (trace pow arg)
> > (trace pow arg)
> trace: the top-level value of arg is not a procedure
> > (define arg (lambda () 5))
> > (trace pow arg)
> (pow arg)

> which is not what I expected.  How is it done?

> Thanks,
>   -- john
> Today is the first day of the rest of your life.
> ...
> Unless you die today.

> Sent via Deja.com http://www.deja.com/
> Before you buy.



Fri, 18 Apr 2003 07:42:22 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. using trace at WinNT command line

2. Strange bug using trace and tixLabelEntry

3. Using trace to make readonly variables

4. command traces interfere with step traces (bug?)

5. TIP #102: Change [trace list] to [trace info]

6. trace on & trace off

7. Tracing Using Modelsim

8. COBOL program variable trace using CEDF

9. Stack trace terminated abnormally using IVF and NT-MPICH

10. Using controlled types to trace program execution

11. tracing a program using __import__('__main__')?

12. creating a trace using Tcl_CreateObjTrace

 

 
Powered by phpBB® Forum Software