home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / pcl / src-16f.lha / code / struct.lisp < prev    next >
Encoding:
Text File  |  1992-05-30  |  3.3 KB  |  92 lines

  1. ;;; -*- Log: code.log; Package: Lisp -*-
  2. ;;;
  3. ;;; **********************************************************************
  4. ;;; This code was written as part of the CMU Common Lisp project at
  5. ;;; Carnegie Mellon University, and has been placed in the public domain.
  6. ;;; If you want to use this code or any part of CMU Common Lisp, please contact
  7. ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
  8. ;;;
  9. (ext:file-comment
  10.   "$Header: struct.lisp,v 1.14 92/03/09 14:57:51 ram Exp $")
  11. ;;;
  12. ;;; **********************************************************************
  13. ;;;
  14. ;;;    This file contains structure definitions that need to be compiled early
  15. ;;; for bootstrapping reasons.
  16. ;;;
  17. (in-package 'lisp)
  18.  
  19. ;;;; Defstruct structures:
  20.  
  21. (in-package 'c)
  22.  
  23. (defstruct (defstruct-description
  24.              (:conc-name dd-)
  25.              (:print-function print-defstruct-description)
  26.          (:make-load-form-fun :just-dump-it-normally))
  27.   name                ; name of the structure
  28.   doc                ; documentation on the structure
  29.   slots                ; list of slots
  30.   conc-name            ; prefix for slot names
  31.   (constructors ())        ; list of standard constructor function names
  32.   boa-constructors        ; BOA constructors (cdr of option).
  33.   copier            ; name of copying function
  34.   predicate            ; name of type predictate
  35.   include            ; name of included structure
  36.   (includes ())            ; names of all structures included by this one
  37.   (included-by ())        ; names of all strctures that include this one 
  38.   print-function        ; function used to print it
  39.   type                ; type specified, Structure if no type specified.
  40.   lisp-type            ; actual type used for implementation.
  41.   named                ; T if named, Nil otherwise
  42.   offset            ; first slot's offset into implementation sequence
  43.   (length nil :type (or fixnum null)) ; total length of the thing
  44.   make-load-form-fun)        ; make-load-form function.
  45.  
  46.  
  47. (defstruct (defstruct-slot-description
  48.              (:conc-name dsd-)
  49.              (:print-function print-defstruct-slot-description)
  50.          (:make-load-form-fun :just-dump-it-normally))
  51.   %name                ; string name of slot
  52.   ;;
  53.   ;; its position in the implementation sequence
  54.   (index (required-argument) :type fixnum)
  55.   ;;
  56.   ;; Name of accesor, or NIL if this accessor has the same name as an inherited
  57.   ;; accessor (which we don't want to shadow.)
  58.   accessor
  59.   default            ; default value
  60.   type                ; declared type
  61.   read-only)            ; T if there's to be no setter for it
  62.  
  63.  
  64. (in-package 'lisp)
  65.  
  66. ;;;; The stream structure:
  67.  
  68. (defconstant in-buffer-length 100 "The size of a stream in-buffer.")
  69.  
  70. (defstruct (stream (:predicate streamp) (:print-function %print-stream))
  71.   ;;
  72.   ;; Buffered input.
  73.   (in-buffer nil :type (or (simple-array * (*)) null))
  74.   (in-index in-buffer-length :type index)    ; Index into in-buffer
  75.   (in #'ill-in :type function)            ; Read-Char function
  76.   (bin #'ill-bin :type function)        ; Byte input function
  77.   (n-bin #'ill-bin :type function)        ; N-Byte input function
  78.   (out #'ill-out :type function)        ; Write-Char function
  79.   (bout #'ill-bout :type function)        ; Byte output function
  80.   (sout #'ill-out :type function)        ; String output function
  81.   (misc #'do-nothing :type function))        ; Less used methods
  82.  
  83.  
  84. ;;; Condition structures:
  85.  
  86. (in-package "CONDITIONS")
  87.  
  88. (defstruct (condition (:constructor |constructor for condition|)
  89.                       (:predicate nil)
  90.                       (:print-function condition-print))
  91.   )
  92.