GBBopen Corechange-class*skip-deleted-unit-instance-class-change*GoTo Top

*skip-deleted-unit-instance-class-change*   [Variable]

Purpose
Controls whether the class of a unit instance is changed to a deleted-unit-instance when it is deleted.

Package   :gbbopen

Module   :gbbopen-core

Value type   A generalized boolean

Initial value   nil

Description
When *skip-deleted-unit-instance-class-change* is nil, the class of a unit instance is changed to a deleted-unit-instance when it is deleted. This helps identify a deleted unit instance that is used inadvertently, at the minor additional cost of the class change when the instance is deleted. In situations where unit instances are created and deleted at a high rate, the class change can be skipped by binding *skip-deleted-unit-instance-class-change* to a non-nil value. The predicate instance-deleted-p can be used to detect either form of a deleted unit instance.

See also
    check-for-deleted-instance
    delete-instance
    deleted-instance-class
    deleted-unit-instance
    instance-deleted-p

Example
Create and delete a hyp unit instance, first with the default changing-class behavior of delete-instance and then with the class-change skipped:

  > (delete-instance (make-instance 'hyp))
  #<deleted-unit-instance hyp 1>
  > (instance-deleted-p *)
  t
  > (let ((*skip-deleted-unit-instance-class-change* 't))
       (delete-instance (make-instance 'hyp)))
  #<hyp [Deleted] 2>
  > (instance-deleted-p *)
  t
  >


The GBBopen Project


GBBopen Corechange-class*skip-deleted-unit-instance-class-change*GoTo Top