Re: SICP Chapter 2, Footnote 3
- From: "H." <hbe123@xxxxxxxxx>
- Date: 22 Jan 2006 17:13:29 -0800
> Regarding your original question, note that a procedure can well be
> called without using its name directly.
>
> (define (foo callback)
> .... (callback) ...)
>
> (define (my-func) ...)
> (trace my-func)
> (foo my-func)
>
> If we want to see all the places where my-func is called, the tracing
> must also be activated from inside foo. This is much easier to
> accomplish if the my-func _procedure_ is specially tagged instead of
> the variable that is bound to it.
That's a good point. I tested that explicitly in UCB Scheme after
reading your post and would guess that it's doing something more
sophisticated and harder to implement since it behaves as I expect and
want it to..
(define combine cons)
(define (dummy-test fn val1 val2)
(fn val1 (fn val2 '())))
STk>(trace combine)
okay
STk>(dummy-test cons 1 2)
(1 2)
STk>(dummy-test combine 1 2)
[4 lines of trace output]
(1 2)
The SICP footnote may not have been accounting for these types of
implementations. I'm glad, however, that UCB Scheme works in this
fashion; it makes my life easier. :-)
.
- Follow-Ups:
- Re: SICP Chapter 2, Footnote 3
- From: Max Hailperin
- Re: SICP Chapter 2, Footnote 3
- References:
- SICP Chapter 2, Footnote 3
- From: H.
- Re: SICP Chapter 2, Footnote 3
- From: Max Hailperin
- Re: SICP Chapter 2, Footnote 3
- From: H.
- Re: SICP Chapter 2, Footnote 3
- From: Lauri Alanko
- SICP Chapter 2, Footnote 3
- Prev by Date: Re: Difference between let, let* and letrec
- Next by Date: Re: Difference between let, let* and letrec
- Previous by thread: Re: C Query
- Next by thread: Re: SICP Chapter 2, Footnote 3
- Index(es):
Relevant Pages
|