;;; -*- Mode: Common-Lisp; Package: User; Base: 10.; Patch-File: T -*-

;;; Reason: Added a report option to the definition of the
;;; TYPE-ERROR condition.

;;;                           RESTRICTED RIGHTS LEGEND
;;;
;;; Use, duplication, or disclosure by the Government is subject to
;;; restrictions as set forth in subdivision (c)(1)(ii) of the Rights in
;;; Technical Data and Computer Software clause at 52.227-7013.
;;;
;;;   TEXAS INSTRUMENTS INCORPORATED      
;;;   P.O. BOX 2909, M/S 2151             
;;;   AUSTIN, TEXAS 78769                 
;;;
;;; Copyright (C) 1989 Texas Instruments Incorporated.
;;; All rights reserved.

;;; Patch file for CLEH version 6.5
;;; Written 07/17/89 10:40:19 by MCCREARY,
;;; while running on Jules-Verne from band LODA
;;; With SYSTEM 6.13, VIRTUAL-MEMORY 6.1, Inconsistent EH 6.4, MAKE-SYSTEM 6.0, MICRONET 6.0,
;;;  LOCAL-FILE 6.0, BASIC-PATHNAME 6.1, NETWORK-SUPPORT-COLD 6.0, BASIC-NAMESPACE 6.1,
;;;  NETWORK-NAMESPACE 6.0, DISK-IO 6.1, DISK-LABEL 6.0, BASIC-FILE 6.2, MAC-PATHNAME 6.0,
;;;  NETWORK-PATHNAME 6.0, COMPILER 6.9, TV 6.12, DATALINK 6.0, CHAOSNET 6.0, GC 6.3,
;;;  MEMORY-AUX 6.0, NVRAM 6.1, SYSLOG 6.1, STREAMER-TAPE 6.4, UCL 6.0, INPUT-EDITOR 6.0,
;;;  METER 6.1, ZWEI 6.4, DEBUG-TOOLS 6.3, NETWORK-SUPPORT 6.0, NETWORK-SERVICE 6.1,
;;;  DATALINK-DISPLAYS 6.0, FONT-EDITOR 6.1, SERIAL 6.0, PRINTER 6.3, MAC-PRINTER-TYPES 6.1,
;;;  PRINTER-TYPES 6.1, IMAGEN 6.0, SUGGESTIONS 6.0, MAIL-DAEMON 6.2, MAIL-READER 6.2,
;;;  TELNET 6.0, VT100 6.0, NAMESPACE-EDITOR 6.0, PROFILE 6.1, VISIDOC 6.2, TI-CLOS 6.19,
;;;  CLEH 6.4, IP 3.47, Experimental BUG 11.10, Experimental CLX 6.2, CLUE 6.9, X11M 6.1,
;;;   microcode 429, Band Name: 6.0 time

#!C
; From file CL-PREDEFINED-CONDITION-TYPES.LISP#> CLEH; MR-X:
#10R CONDITIONS#:
(COMPILER-LET ((*PACKAGE* (FIND-PACKAGE "CONDITIONS"))
                          (SI:*LISP-MODE* :COMMON-LISP)
                          (*READTABLE* SYS:COMMON-LISP-READTABLE)
                          (SI:*READER-SYMBOL-SUBSTITUTIONS* SYS::*COMMON-LISP-SYMBOL-SUBSTITUTIONS*))
  (COMPILER#:PATCH-SOURCE-FILE "SYS: CLEH; CL-PREDEFINED-CONDITION-TYPES.#"


(DEFINE-CONDITION type-error (error)
  ((datum :initarg :datum :reader type-error-datum)
   (expected-type :initarg :expected-type :reader type-error-expected-type))
  (:report (lambda (condition stream)
	     (if (send condition :format-string)
		 (clos:call-next-method)
		 (format stream "~s was not of the expected type ~s."
			 (type-error-datum condition)
			 (type-error-expected-type condition)) )))
  (:documentation
"Errors in the transfer of data in a program should inherit from this
type.  This is a subtype of ERROR.  For example, conditions to be
signalled by CHECK-TYPE should inherit from this type.  The init
keywords :DATUM and :EXPECTED-TYPE are supported to initialize the
slots, which can be accessed using TYPE-ERROR-DATUM and
TYPE-ERROR-EXPECTED-TYPE."))
))
