Ignore:
Timestamp:
02/08/05 16:43:30 (17 years ago)
Author:
piso
Message:

Work in progress.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/trace.lisp

    r8502 r8506  
    22;;;
    33;;; Copyright (C) 2003-2005 Peter Graves
    4 ;;; $Id: trace.lisp,v 1.9 2005-02-08 02:40:49 piso Exp $
     4;;; $Id: trace.lisp,v 1.10 2005-02-08 16:43:30 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    4848    results))
    4949
    50 (defun trace-1 (symbol breakp)
    51   (unless (fboundp symbol)
    52     (error "~S is not the name of a function" symbol))
    53   (if (member symbol *traced-functions*)
    54       (%format t "~S is already being traced." symbol)
    55       (let* ((untraced-function (symbol-function symbol))
     50(defun trace-1 (name breakp)
     51  (unless (fboundp name)
     52    (error "~S is not the name of a function" name))
     53  (if (member name *traced-functions*)
     54      (%format t "~S is already being traced." name)
     55      (let* ((untraced-function (symbol-function name))
    5656             (trace-function
    5757              (lambda (&rest args)
    5858                (with-standard-io-syntax
    5959                    (%format *trace-output* (indent "~D: ~S~%") *trace-depth*
    60                              (cons symbol args)))
     60                             (cons name args)))
    6161                (when breakp
    6262                  (break))
     
    6565                  (decf *trace-depth*)
    6666                  (with-standard-io-syntax
    67                     (%format *trace-output* (indent "~D: ~A returned") *trace-depth* symbol)
     67                    (%format *trace-output* (indent "~D: ~A returned") *trace-depth* name)
    6868                      (dolist (val r)
    6969                        (%format *trace-output* " ~S" val))
     
    7171                  (values-list r)))))
    7272        (let ((*warn-on-redefinition* nil))
    73           (setf (symbol-function symbol) trace-function))
    74         (setf (get symbol *untraced-function*) untraced-function)
    75         (push symbol *traced-functions*)
    76         symbol)))
     73          (setf (symbol-function name) trace-function))
     74        (setf (get name *untraced-function*) untraced-function)
     75        (push name *traced-functions*)
     76        name)))
    7777
    7878(defun indent (string)
Note: See TracChangeset for help on using the changeset viewer.