CLIM mail archive

[Prev][Next][Index][Thread]

CLIM 1.1 erase-output-record ?



      Date: Thu, 30 Jun 1994 10:31 CDT
      From: John Aspinall <jga@harlequin.com>

	 Date: Thu, 30 Jun 1994 10:51:35 -0400
	 From: Jeff Morrill <jmorrill@BBN.COM>

	 This is indeed a FAQ.  You are getting bitten by the bug in
	 coordinate sorted sets.  I don't know if there are any other
	 types of output records in clim 1.

      But it's not the same bug as Marilyn Bunzo's bug.  In Everett's
      case, he's looking up a known-to-be-present output-record.  There
      *is* a fix for Everett's bug - I was still at 'Bolics when Scott and
      I put it in, and it's in the CLIM 2 sources.

Thanks to David Gadbois, I have the CLIM 1 method in front of me.  I'm
surprised this wasn't a patch in the 1991-2 timeframe, but perhaps not.
In any case, try this:

;;; -*- Mode: LISP; Syntax: Common-lisp; Package: CLIM; Base: 10; Lowercase: Yes -*-

(defmethod delete-output-record-element
    ((record coordinate-sorted-set-output-record) element &optional (errorp t))
  (with-slots (coordinate-sorted-set fill-pointer tallest-box-height) record
    (let ((index (or (coordinate-sorted-set-position 
			element coordinate-sorted-set fill-pointer)
		     (position element coordinate-sorted-set))))
       (cond (index
	     (let ((new-fp (the fixnum (1- fill-pointer)))
		   (vector coordinate-sorted-set))
	       (declare (type simple-vector vector) #+Genera (sys:array-register vector))
	       (unless (= index new-fp)
		 ;; Shift the whole vector downward
		 (do ((i index (1+ i)))
		     ((= i new-fp))
		   (declare (fixnum i index new-fp)
			    (optimize (speed 3) (safety 0)))
		   (setf (svref vector i) (svref vector (1+ i)))))
	       (setf fill-pointer new-fp)
	       t))
	    (errorp
	     (error "The element ~S was not found in ~S" element record))))))



Main Index | Thread Index