* dgnushack.el (merge): Don't use coerce.
authorShengHuo ZHU <zsh@cs.rochester.edu>
Tue, 6 Aug 2002 17:57:14 +0000 (17:57 +0000)
committerShengHuo ZHU <zsh@cs.rochester.edu>
Tue, 6 Aug 2002 17:57:14 +0000 (17:57 +0000)
lisp/ChangeLog
lisp/dgnushack.el

index 6ebcbb4..0527b7b 100644 (file)
@@ -1,3 +1,7 @@
+2002-08-06  ShengHuo ZHU  <zsh@cs.rochester.edu>
+
+       * dgnushack.el (merge): Don't use coerce.
+
 2002-05-27  Jesper Harder  <harder@ifa.au.dk>
 
        * mailcap.el (mailcap-mime-data): Test window-system rather than
index 1554658..0f4041f 100644 (file)
             (if (funcall pred (car seq2) (car seq1))
                 (push (pop seq2) res)
               (push (pop seq1) res)))
-          (coerce (nconc (nreverse res) seq1 seq2) type)))))
+          (let ((x (nconc (nreverse res) seq1 seq2)))
+            (cond ((eq type 'list) (if (listp x) x (append x nil)))
+                  ((eq type 'vector) (if (vectorp x) x (vconcat x)))
+                  ((eq type 'string) (if (stringp x) x (concat x)))
+                  ((eq type 'array) (if (arrayp x) x (vconcat x)))
+                  ((and (eq type 'character) (stringp x) (= (length x) 1))
+                   (aref x 0))
+                  ((and (eq type 'character) (symbolp x)) 
+                   (aref (symbol-name x) 0))
+                  ((eq type 'float) (float x))
+                  ((typep x type) x)
+                  (t (error "Can't coerce %s to type %s" x type))))))))
 
   (define-compiler-macro copy-list (&whole form list)
     (if (and (fboundp 'copy-list)