Changeset 2649

Show
Ignore:
Timestamp:
03/04/08 12:41:26 (10 months ago)
Author:
hans
Message:

Add subseq* which works like subseq, but ignores END arguments that are too large

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/bknr/datastore/src/data/object.lisp

    r2640 r2649  
    9090(defmethod (setf slot-value-using-class) :after (newval (class persistent-class) object slotd) 
    9191  (when (in-anonymous-transaction-p) 
    92     (push (make-instance 'transaction :timestamp (get-universal-time) 
    93                          :function-symbol 'change-slot-values 
     92    (push (make-instance 'transaction 
     93                         :timestamp (get-universal-time) 
     94                         :function-symbol 'tx-change-slot-values 
    9495                         :args (list object (slot-definition-name slotd) newval)) 
    9596          (anonymous-transaction-transactions *current-transaction*)))) 
     
    265266;;; binary snapshot 
    266267 
    267 (defvar *current-object-slot*
    268 (defvar *current-slot-relaxed-p*
     268(defvar *current-object-slot* nil
     269(defvar *current-slot-relaxed-p* nil
    269270 
    270271(defun encode-layout (id class slots stream) 
  • trunk/bknr/datastore/src/data/txn.lisp

    r2612 r2649  
    404404(defmethod execute-unlogged ((transaction transaction)) 
    405405  (with-store-guard () 
    406     (let* ((function (or (symbol-function (transaction-function-symbol transaction)) 
    407                          (error "Undefined transaction function ~A, please ensure that all the necessary code is loaded." 
    408                                 (transaction-function-symbol transaction)))) 
    409           (*current-transaction* transaction)) 
    410       (apply function (transaction-args transaction))))) 
     406    (let ((*current-transaction* transaction)) 
     407      (apply (or (symbol-function (transaction-function-symbol transaction)) 
     408                 (error "Undefined transaction function ~A, please ensure that all the necessary code is loaded." 
     409                        (transaction-function-symbol transaction))) 
     410            (transaction-args transaction))))) 
    411411 
    412412(defun fsync (stream) 
  • trunk/bknr/datastore/src/utils/package.lisp

    r2619 r2649  
    142142 
    143143           ;; norvig 
    144            #:find-all)) 
     144           #:find-all 
     145 
     146           ;; misc 
     147           #:subseq*)) 
  • trunk/bknr/datastore/src/utils/utils.lisp

    r2619 r2649  
    544544     (format nil "~A" byte-count)))) 
    545545 
     546(defun subseq* (sequence start &optional end) 
     547  "Like SUBSEQ, but limit END to the length of SEQUENCE" 
     548  (subseq sequence start (when end 
     549                           (min end (length sequence)))))