Changeset 4824


Ignore:
Timestamp:
11/18/03 03:18:47 (18 years ago)
Author:
piso
Message:

Work in progress.

File:
1 edited

Legend:

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

    r4823 r4824  
    22;;;
    33;;; Copyright (C) 2003 Peter Graves
    4 ;;; $Id: defstruct.lisp,v 1.33 2003-11-18 02:58:20 piso Exp $
     4;;; $Id: defstruct.lisp,v 1.34 2003-11-18 03:18:47 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    7373    (let ((pred (intern *ds-predicate*)))
    7474      (cond ((eq *ds-type* 'list)
    75              `((defun ,pred (object)
    76                  (and (consp object) (eq (car object) ',*ds-name*)))))
     75             (if *ds-initial-offset*
     76                 `((defun ,pred (object)
     77                     (and (consp object)
     78                          (> (length object) ,*ds-initial-offset*)
     79                          (eq (elt object ,*ds-initial-offset*) ',*ds-name*))))
     80                 `((defun ,pred (object)
     81                     (and (consp object) (eq (car object) ',*ds-name*))))))
    7782            ((or (eq *ds-type* 'vector)
    7883                 (and (consp *ds-type*) (eq (car *ds-type*) 'vector)))
    79              `((defun ,pred (object)
    80                  (and (vectorp object)
    81                       (> (length object) 0)
    82                       (eq (aref object 0) ',*ds-name*)))))
     84             (let ((index (or *ds-initial-offset* 0)))
     85               `((defun ,pred (object)
     86                   (and (vectorp object)
     87                        (> (length object) ,index)
     88                        (eq (aref object ,index) ',*ds-name*))))))
    8389            (t
    8490             `((defun ,pred (object)
Note: See TracChangeset for help on using the changeset viewer.