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

;;; Reason: Modified transform-symbolics-value to handle the case were we got a :user-property with only one value. We set the attribute name to the value and set its value to T.[10150]

;;;                           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 12/11/89 14:27:36 by berger,
;;; while running on ARIES from band LODX
;;; With SYSTEM 6.27, VIRTUAL-MEMORY 6.3, EH 6.5, MAKE-SYSTEM 6.2, MICRONET 6.0, LOCAL-FILE 6.1,
;;;  BASIC-PATHNAME 6.2, NETWORK-SUPPORT-COLD 6.2, BASIC-NAMESPACE 6.7, NETWORK-NAMESPACE 6.0,
;;;  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.21, 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.11,
;;;  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.4, MAIL-READER 6.6, TELNET 6.0, VT100 6.0,
;;;  NAMESPACE-EDITOR 6.4, PROFILE 6.2, VISIDOC 6.7, TI-CLOS 6.26, CLEH 6.5, IP 3.56,
;;;  Experimental CLX 6.7, CLUE 6.35, X11M 6.19, Experimental BUG 11.17,  microcode 429,
;;;  Band Name: REL 6.0 + SLE 11/28

#!C
; From file REMOTE-SYMBOLICS.LISP#> NAMESPACE; SYS:
#10R NAME#:
(COMPILER-LET ((*PACKAGE* (FIND-PACKAGE "NAME"))
                          (SI:*LISP-MODE* :COMMON-LISP)
                          (*READTABLE* SYS:COMMON-LISP-READTABLE)
                          (SI:*READER-SYMBOL-SUBSTITUTIONS* SYS::*COMMON-LISP-SYMBOL-SUBSTITUTIONS*))
  (COMPILER#:PATCH-SOURCE-FILE "SYS: NAMESPACE; REMOTE-SYMBOLICS.#"


(defun transform-symbolics-value (symbolics-attribute value &optional class)
  (declare (ignore class))
  (unless (listp value)
      ; DAB 12-11-89 Unknown format, assume the value is the property name and set it value to T. [10150]
    (setf value (list value "T")))
  ;; Symb -> Exp
  (let (f
	(transformed-attribute symbolics-attribute)
	(transformed-value value))
    
    (when *do-symbolics-transformations*
      
      (when (setf f (third (assoc symbolics-attribute *symbolics-attribute-mappings* :test 'eq)))	
	(setf transformed-value (funcall f symbolics-attribute value)))
      
      (setf transformed-attribute (get-explorer-attribute symbolics-attribute))

      (when (eq transformed-attribute :user-property)
	(setf transformed-attribute (intern-as-keyword (first value)))
	(let ((length (length (the string (second value))))
	      last-char-read
	      errorp
	      v
	      (*read-base* 10.)
	      (*package* *package*))
	  (unless (or (string-equal (second value) "nil")   ;08-10-88 DAB  Special case t and nil, otherwise :T and :nil
		      (string-equal (second value) "T"))    ;will be returned.
		   (setq *package* (find-package 'keyword)))

	  (setf (values nil errorp) 
		(ignore-errors (setf (values v last-char-read)
				     (read-from-string (second value) nil))))

	  (setf transformed-value (cond ((or errorp
					     (not (eql length last-char-read)))
					 (second value))
					(t v))))))
    
    (values transformed-value transformed-attribute)))
))
