Changeset 8542


Ignore:
Timestamp:
02/12/05 03:23:46 (16 years ago)
Author:
piso
Message:

Work in progress.

File:
1 edited

Legend:

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

    r8535 r8542  
    22;;;
    33;;; Copyright (C) 2005 Peter Graves
    4 ;;; $Id: describe.lisp,v 1.1 2005-02-11 22:08:02 piso Exp $
     4;;; $Id: describe.lisp,v 1.2 2005-02-12 03:23:46 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    2727      (arglist object)
    2828    (when known-p
    29       (if arglist
    30           (format stream "~&The function's arguments are:~%  ~A~%" arglist)
    31           (format stream "~&The function takes no arguments.")))))
     29      (format stream "~&The function's lambda list is:~%  ~A~%" arglist))))
     30
     31(defun %describe (object stream)
     32  (format stream "~S is an object of type ~S.~%" object (type-of object)))
    3233
    3334(defun describe (object &optional stream)
     
    6162           (format stream "Its function binding is ~S.~%" function)
    6263           (describe-arglist function stream)))
     64       (let ((docstring (get object '%function-documentation)))
     65         (when docstring
     66           (format stream "Function documentation:~%  ~A~%" docstring)))
    6367       (let ((plist (symbol-plist object)))
    6468         (when plist
    65            (format stream "The symbol's property list has these indicator/value pairs:~%")
     69           (format stream "The symbol's property list contains these indicator/value pairs:~%")
    6670           (loop
    6771             (when (null plist) (return))
     
    6973             (setf plist (cddr plist))))))
    7074      (FUNCTION
    71        (format stream "~S is an object of type ~S.~%" object (type-of object))
     75       (%describe object stream)
    7276       (describe-arglist object stream))
     77      (INTEGER
     78       (%describe object stream)
     79       (format stream "~D.~%~
     80                       #x~X~%~
     81                       #o~O~%~
     82                       #b~B~%"
     83               object object object object))
    7384      (t
    7485       (%describe object stream))))
Note: See TracChangeset for help on using the changeset viewer.