[climacs-cvs] CVS update: climacs/Persistent/persistent-base-test.lisp climacs/Persistent/persistent-buffer.lisp climacs/Persistent/persistent-buffer-test.lisp

Aleksandar Bakic abakic at common-lisp.net
Wed Jan 26 18:29:00 UTC 2005


Update of /project/climacs/cvsroot/climacs/Persistent
In directory common-lisp.net:/tmp/cvs-serv9143

Modified Files:
	persistent-base-test.lisp persistent-buffer.lisp 
	persistent-buffer-test.lisp 
Log Message:
Cleanup and some more info.

Date: Wed Jan 26 10:28:57 2005
Author: abakic

Index: climacs/Persistent/persistent-base-test.lisp
diff -u climacs/Persistent/persistent-base-test.lisp:1.1 climacs/Persistent/persistent-base-test.lisp:1.2
--- climacs/Persistent/persistent-base-test.lisp:1.1	Wed Jan 26 08:10:45 2005
+++ climacs/Persistent/persistent-base-test.lisp	Wed Jan 26 10:28:56 2005
@@ -461,26 +461,6 @@
        (number-of-lines-in-region 10 m2r))))
   1 1 1 1 0 0 0 1 1)
 
-(deftest constituentp.test-1 ; NOTE: more tests may be needed for sbcl
-  (values
-   (constituentp #\a)
-   (constituentp #\Newline)
-   (constituentp #\Space)
-   (constituentp #\Tab)
-   (constituentp "a")
-   (constituentp #\Null))
-  t nil nil nil nil nil)
-
-(deftest whitespacep.test-1
-  (values
-   (not (null (whitespacep #\a)))
-   (not (null (whitespacep #\Newline)))
-   (not (null (whitespacep #\Space)))
-   (not (null (whitespacep #\Tab)))
-   (not (null (whitespacep " ")))
-   (not (null (whitespacep #\Null))))
-  nil nil t t nil nil)
-
 (deftest binseq-buffer-forward-to-word-boundary.test-1
   (let ((buffer (make-instance 'binseq-buffer)))
     (insert-buffer-sequence buffer 0 "  climacs
@@ -1080,26 +1060,6 @@
        (number-of-lines-in-region m2l 10)
        (number-of-lines-in-region 10 m2r))))
   1 1 1 1 0 0 0 1 1)
-
-(deftest constituentp.test-1 ; NOTE: more tests may be needed for sbcl
-  (values
-   (constituentp #\a)
-   (constituentp #\Newline)
-   (constituentp #\Space)
-   (constituentp #\Tab)
-   (constituentp "a")
-   (constituentp #\Null))
-  t nil nil nil nil nil)
-
-(deftest whitespacep.test-1
-  (values
-   (not (null (whitespacep #\a)))
-   (not (null (whitespacep #\Newline)))
-   (not (null (whitespacep #\Space)))
-   (not (null (whitespacep #\Tab)))
-   (not (null (whitespacep " ")))
-   (not (null (whitespacep #\Null))))
-  nil nil t t nil nil)
 
 (deftest obinseq-buffer-forward-to-word-boundary.test-1
   (let ((buffer (make-instance 'obinseq-buffer)))


Index: climacs/Persistent/persistent-buffer.lisp
diff -u climacs/Persistent/persistent-buffer.lisp:1.1 climacs/Persistent/persistent-buffer.lisp:1.2
--- climacs/Persistent/persistent-buffer.lisp:1.1	Wed Jan 26 08:10:45 2005
+++ climacs/Persistent/persistent-buffer.lisp	Wed Jan 26 10:28:56 2005
@@ -24,6 +24,9 @@
 
 (in-package :climacs-buffer)
 
+;;; For now, pos contains just an integer, while it might contain a cons
+;;; of two adjacent buffer elements for higher performance (with the help
+;;; of buffer implementation, especially the rebalancing part).
 (defclass persistent-cursor ()
   ((buffer :reader buffer :initarg :buffer) ; TODO: fix overlap with mark?
    (pos :accessor cursor-pos))
@@ -151,6 +154,9 @@
      while (> i 0)
      until (eql (buffer-object buffer (1- i)) #\Newline)
      count t))
+
+;;; the old value of the CONTENTS slot is dropped upon modification
+;;; it can be saved for UNDO purposes in a history tree, by an UNDOABLE-BUFFER
 
 (defmethod insert-buffer-object ((buffer binseq-buffer) offset object)
   (assert (<= 0 offset (size buffer)) ()


Index: climacs/Persistent/persistent-buffer-test.lisp
diff -u climacs/Persistent/persistent-buffer-test.lisp:1.1 climacs/Persistent/persistent-buffer-test.lisp:1.2
--- climacs/Persistent/persistent-buffer-test.lisp:1.1	Wed Jan 26 08:10:45 2005
+++ climacs/Persistent/persistent-buffer-test.lisp	Wed Jan 26 10:28:56 2005
@@ -53,11 +53,7 @@
   (flet ((%all-eq (&optional x y)
 	   (cond
 	     ((null x) nil)
-	     (t (when (eq x y) y))))
-	 (%all-= (&optional x y)
-	   (cond
-	     ((null x) nil)
-	     (t (when (= x y) y)))))
+	     (t (when (eq x y) y)))))
     (let* ((buffer (make-instance 'binseq-buffer))
 	   (low (slot-value buffer 'low-mark))
 	   (high (slot-value buffer 'high-mark))
@@ -762,11 +758,7 @@
   (flet ((%all-eq (&optional x y)
 	   (cond
 	     ((null x) nil)
-	     (t (when (eq x y) y))))
-	 (%all-= (&optional x y)
-	   (cond
-	     ((null x) nil)
-	     (t (when (= x y) y)))))
+	     (t (when (eq x y) y)))))
     (let* ((buffer (make-instance 'obinseq-buffer))
 	   (low (slot-value buffer 'low-mark))
 	   (high (slot-value buffer 'high-mark))




More information about the Climacs-cvs mailing list