All Manuals > LispWorks User Guide and Reference Manual > 25 The CLOS Package

NextPrevUpTopContentsIndex

trace-new-instances-on-access

Function
Summary

Traces new instances of a given class, based on access modes.

Package

clos

Signature

trace-new-instances-on-access class-designator &key read write slot-names break when process trace-output entrycond eval-before before backtrace => t

Arguments

class-designator

The class to trace.

Values

Returns t .

Description

Causes new instances of the class given by class-designator to be traced for the access modes given by read , write and slot-names .

The keyword arguments control which type of access are traced, and provide preconditions for tracing, code to run before access, and how to print any trace output. They are interpreted as described for trace-on-access.

This function, when used with the :break keyword, replaces the deprecated function break-new-instances-on-access.

Example
(trace-new-instances-on-access 'capi:display-pane
                               :slot-names nil)

Suppose you have a bug whereby the slot bar of an instance of your class foo is incorrectly being set to a negative integer value. You could cause entry into the debugger at the point where the slot is set incorrectly by evaluating this form:

(clos:trace-new-instances-on-access
  'foo
  :slot-names '(bar)
  :read nil
  :when '(and (integerp (car *traced-arglist*))
              (< (car *traced-arglist*) 0))
  :break t)

and running your program.

See also

break-new-instances-on-access
untrace-new-instances-on-access
trace-on-access


LispWorks User Guide and Reference Manual - 21 Dec 2011

NextPrevUpTopContentsIndex