[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tracing methods

    Received: from yale by csi via UUCP;  Tue, 19 Mar 85 09:22:56 EST
    Received: from yale (yale.arpa.ARPA) by yale-comix.YALE.ARPA; Tue, 19 Mar 85 08:33:32 est
    Received: by YALE-BULLDOG.YALE.ARPA; 19 Mar 85 08:23:04 EST (Tue)
    Received: by YALE-RING.YALE.ARPA; 19 Mar 85 08:23:09 EDT (Tue)
    Date: 19 Mar 85 08:23:09 EDT (Tue)
    From: Larry Hunter <hunter@yale>
    To: t-discussion@yale

    Is there an easy way of tracing methods?

No.  Your best bet is to rewrite the method so that it's a simple call
to a top-level procedure, and then trace that.

    It seems like they are just plain procedures (hence tracable) but
    I don't know how to pass their location to trace....
All LAMBDA-forms are "just plain procedures," but that doesn't make them
traceable.  I agree that it would be nice to have this capability, but
the general problem is very hard.  First of all, there's no notation
for pointing to LAMBDAs in arbitrary places, and in T, they're all over
the place. Second, what about compiled LAMBDAs?  There's sometimes nothing
out there to trace -- the code for a particular LAMBDA may just blend
in with the rest of the instruciton stream.  Third, sometimes LAMBDAs
appear and disappear during various transformations such as macro-expansion
and optimization.  For example, TC expands (OR A B) into
              ((LAMBDA (P R) (IF P P (R))) A (LAMBDA () B))
and later boils that down to a mere (IF A A B) [for the case of simple
variables].  So you need to be able to say not only WHERE the procedure
is, but WHEN it is.  I'm not sure about this, but a method clause like
((FOO self arg-1 arg2) (BAZ self arg-1 arg2)), which probably expands
into (LAMBDA (self arg-1 arg-2) (BAZ self arg-2 arg-2)), might later
be optimized into BAZ [assuming BAZ isn't a special form], in which case
it'll be hard to trace the method.  Groan.

On the other hand, it's reasonable to look at the most useful cases of
tracing, such as procedures defined inside LABELS-forms and methods inside
OBJECT-forms as you suggest, and it's something that we're looking into,
but it does require a whole new set of tools.