Changeset 3505


Ignore:
Timestamp:
08/25/03 14:56:58 (19 years ago)
Author:
piso
Message:

PRINT-UNREADABLE-OBJECT

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/boot.lisp

    r3503 r3505  
    22;;;
    33;;; Copyright (C) 2003 Peter Graves
    4 ;;; $Id: boot.lisp,v 1.97 2003-08-25 13:23:58 piso Exp $
     4;;; $Id: boot.lisp,v 1.98 2003-08-25 14:56:58 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    370370          (close ,var))
    371371   (get-output-stream-string ,var))))
     372
     373
     374(defmacro print-unreadable-object ((object stream &key type identity) &body body)
     375  `(let ((s ,stream)
     376         (obj ,object))
     377     (format s "#<")
     378     ,(when type
     379        '(format s "~S" (type-of obj)))
     380     ,(when (and type (or body identity))
     381        '(format s " "))
     382     ,@body
     383     ,(when (and identity body)
     384        '(format s " "))
     385     ,(when identity
     386        '(format s "@ ~A" (sys::hashcode-to-string obj)))
     387     (format s ">")
     388     nil))
Note: See TracChangeset for help on using the changeset viewer.