Linksdirect-link-definitioncheck-link-definitionsGoTo Top

check-link-definitions   &optional silent => boolean[Function]

Purpose
Check for consistency among link-slot definitions of unit classes.

Package   :gbbopen

Module   :gbbopen-core

Arguments and values

silent     If true, suppress warning/success printing (default is nil)
boolean     A generalized boolean

Returns
True if all link-slot definitions are consistent; nil otherwise.

Description
If a link inconsistency is found, details of the inconsistency are printed to *standard-output*. For clarity, only the first inconsistency is displayed. After the inconsistency has been repaired, check-link-definitions should be used again to check for additional inconsistencies.

See also
    define-unit-class

Examples
Check for consistency in link-slot definitions in all unit classes:

  > (check-link-definitions)
  ;; All link definitions are consistent.
  t
  >
Create a link-slot inconsistency:
  > (define-unit-class bad () 
       ((mismatched-link :link (missing inverse))))
  bad
  > (check-link-definitions)
  ;; Warning: The inverse of link MISMATCHED-LINK in unit-class BAD refers
  ;           to unit-class MISSING, which is not defined.
  nil
  >
Define the missing unit class, but incorrectly:
  > (define-unit-class missing () ((mismatched-link :link (missing bad))))
  missing
  > (check-link-definitions)
  ;; Warning: The inverse of link MISMATCHED-LINK in unit-class MISSING
  ;;          refers to link BAD which is not present in unit-class MISSING.
  nil
  >
Fix the definition and check again:
  > (define-unit-class missing () ((inverse :link (bad mismatched-link))))
  #<standard-unit-class missing>
  > (check-link-definitions)
  ;; All link definitions are consistent.
  t
  >
Check again, but silently:
  > (check-link-definitions 't)
  t
  > 


The GBBopen Project


Linksdirect-link-definitioncheck-link-definitionsGoTo Top