Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker.mit.edu!ai-lab!zurich.ai.mit.edu!jaffer From: jaffer@zurich.ai.mit.edu (Aubrey Jaffer) Newsgroups: comp.lang.scheme Subject: Re: function tracing in Scheme Message-ID: Date: 27 Apr 91 02:34:09 GMT References: Sender: news@ai.mit.edu Distribution: comp.lang.scheme Organization: M.I.T. Artificial Intelligence Lab. Lines: 26 In-reply-to: markf@zurich.ai.mit.edu's message of 26 Apr 91 19:17:41 GMT 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) > 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.