Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!apple!snorkelwacker.mit.edu!ai-lab!zurich.ai.mit.edu!markf From: markf@zurich.ai.mit.edu (Mark Friedman) Newsgroups: comp.lang.scheme Subject: Re: function tracing in Scheme Message-ID: Date: 29 Apr 91 15:09:13 GMT References: Sender: news@ai.mit.edu Reply-To: markf@zurich.ai.mit.edu Distribution: comp.lang.scheme Organization: M.I.T. Artificial Intelligence Lab. Lines: 44 In-reply-to: jaffer@zurich.ai.mit.edu's message of 27 Apr 91 02:34:09 GMT In article jaffer@zurich.ai.mit.edu (Aubrey Jaffer) writes: From : > This is all well and good, but only useful for procedures that are > referenced by name (and it only traces them where they are referenced > by that name, and you lose eq-ness for traced procedures). You need You are right about eq-ness when the function was grabbed before being traced but tracef works for unnamed procedures. > ((tracef (lambda (x) (cons x x))) 9) CALL [#[CLOSURE (x) (cons x x)] 9 ] RETURNED [#[CLOSURE (x) (#@cons #@0+0 #@0+0)] ==> (9 . 9)] ;Evaluation took 0 mSec (0 in gc) 24 cons work (9 . 9) What I meant was that you can't trace the unnamed procedure and have the procedure be side-effected so that all uses of the procedure will be traced. > some hackery in the interpreter and/or compiler to make tracing work > for arbitrary procedures. > > ;;; TRACEF REALLY NEEDS A `PRINT ANYTHING ON ONE LINE' ROUTINE. DOES > ;;; SOMEONE CARE TO WRITE IT? > > Unless I misunderstand what you mean I think that the following will > do it. > ... code deleted ... No. What I meant is a function which prints in such a way as to show as much top-level structure as possible while fitting in one line. It replaces too large sub-structures with ... or & in the printed output. Oh. Never mind. -Mark -- Mark Friedman MIT Artificial Intelligence Lab 545 Technology Sq. Cambridge, Ma. 02139 markf@zurich.ai.mit.edu