Changeset 3594
- Timestamp:
- 09/07/03 16:42:36 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/j/src/org/armedbear/lisp/defstruct.lisp
r2964 r3594 2 2 ;;; 3 3 ;;; Copyright (C) 2003 Peter Graves 4 ;;; $Id: defstruct.lisp,v 1.1 6 2003-07-16 18:17:22piso Exp $4 ;;; $Id: defstruct.lisp,v 1.17 2003-09-07 16:42:36 piso Exp $ 5 5 ;;; 6 6 ;;; This program is free software; you can redistribute it and/or … … 43 43 (typep object ',*ds-name*))))) 44 44 45 (defmacro get-accessor (slot) 46 (case slot 47 (0 #'%structure-ref-0) 48 (1 #'%structure-ref-1) 49 (2 #'%structure-ref-2) 50 (t 51 `(lambda (instance) (%structure-ref instance ,slot))))) 52 45 53 (defun define-access-function (slot-name index) 46 54 (let ((accessor … … 49 57 slot-name)) 50 58 (setf-expander (gensym))) 51 `((defun ,accessor (instance) 52 (%structure-ref instance ,index)) 59 `((setf (symbol-function ',accessor) (get-accessor ,index)) 53 60 (defun ,setf-expander (instance new-value) 54 61 (%structure-set instance ,index new-value))
Note: See TracChangeset
for help on using the changeset viewer.