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

;;; Reason: Modified print-object ((pobj array) to check *print-structure*.

;;;                           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.

;;; Written 02/21/90 08:13:35 by berger,
;;; while running on Pasteur from band LOD2
;;; With SYSTEM 6.29, VIRTUAL-MEMORY 6.3, EH 6.6, MAKE-SYSTEM 6.2, MICRONET 6.0, LOCAL-FILE 6.1,
;;;  BASIC-PATHNAME 6.3, NETWORK-SUPPORT-COLD 6.2, BASIC-NAMESPACE 6.7, NETWORK-NAMESPACE 6.1,
;;;  DISK-IO 6.2, DISK-LABEL 6.0, BASIC-FILE 6.7, MAC-PATHNAME 6.0, NETWORK-PATHNAME 6.0,
;;;  COMPILER 6.14, TV 6.23, DATALINK 6.0, CHAOSNET 6.5, GC 6.3, MEMORY-AUX 6.0, NVRAM 6.2,
;;;  SYSLOG 6.2, STREAMER-TAPE 6.5, UCL 6.0, INPUT-EDITOR 6.0, METER 6.1, ZWEI 6.12,
;;;  DEBUG-TOOLS 6.4, NETWORK-SUPPORT 6.1, NETWORK-SERVICE 6.2, DATALINK-DISPLAYS 6.0,
;;;  FONT-EDITOR 6.1, SERIAL 6.0, PRINTER 6.3, MAC-PRINTER-TYPES 6.1, PRINTER-TYPES 6.2,
;;;  IMAGEN 6.1, SUGGESTIONS 6.1, MAIL-DAEMON 6.5, MAIL-READER 6.7, TELNET 6.1, VT100 6.0,
;;;  NAMESPACE-EDITOR 6.4, PROFILE 6.2, VISIDOC 6.7, TI-CLOS 6.37, CLEH 6.5, IP 3.57,
;;;  Experimental CLX 6.8, CLUE 6.50, X11M 6.20, Experimental BUG 11.18, RPC 6.2,
;;;  NFS 3.10,  microcode 648, Band Name: rel6.0 1/23

#!C
; From file NEW-PRINT-OBJECT.LISP#> CLOS; SYS:
#10R TICLOS#:
(COMPILER-LET ((*PACKAGE* (FIND-PACKAGE "TICLOS"))
                          (SI:*LISP-MODE* :COMMON-LISP)
                          (*READTABLE* SYS:COMMON-LISP-READTABLE)
                          (SI:*READER-SYMBOL-SUBSTITUTIONS* SYS::*COMMON-LISP-SYMBOL-SUBSTITUTIONS*))
  (COMPILER#:PATCH-SOURCE-FILE "SYS: CLOS; NEW-PRINT-OBJECT.#"


(defmethod print-object ((pobj array) stream)
  (declare (special *print-structure*))
  (print-structured-object
    pobj stream
    #'(lambda (pobj stream)
	(if (stringp pobj)
	    (if (<= (array-active-length pobj) (array-total-size pobj))
		(si:print-quoted-string pobj stream t)
	      (si:print-random-object pobj stream t (or si:*prindepth* 0)
				      si:*which-operations* ))
	    (if (named-structure-p pobj) ; DAB 12-28-89 An array can be a structure, if so try to get the
		(let (nss)               ; print-function and use it. [10874]
		  (ignore-errors (setq nss (named-structure-p pobj)))
		  (cond
		    ((and (symbolp nss)
			  (if (boundp '*print-structure* )
			      (null *print-structure*) (null *print-array*))
			  (or (get nss 'named-structure-invoke)
			      (get nss :named-structure-invoke))
			  (member :print-self
				  (named-structure-invoke pobj :which-operations)
				  :test #'eq))
		     (named-structure-invoke pobj :print-self stream (or si:*prindepth* 0)
					     *print-escape*))
		    (t				   ;Named structure that doesn't print itself
		     (si:print-named-structure nss pobj (or si:*prindepth* 0) stream
					       si:*which-operations* ))))
		(si:print-array pobj stream t  (or si:*prindepth* 0) si:*which-operations* ))))))
))
