comparison lisp/cl-macs.el @ 5242:f3eca926258e

Bit vectors are also sequences; enforce this in some CL functions. lisp/ChangeLog addition: 2010-07-24 Aidan Kehoe <kehoea@parhasard.net> * cl-extra.el (concatenate): * cl-seq.el (remove*, cl-delete-duplicates): Bit vectors are also sequences; enforce this in these functions. * cl-macs.el (concatenate): If TYPE is constant, don't inline #'concatenate, replace it by a call to the appropriate C functions.
author Aidan Kehoe <kehoea@parhasard.net>
date Sat, 24 Jul 2010 17:38:35 +0100
parents 7789ae555c45
children 0d436a78c514
comparison
equal deleted inserted replaced
5241:d579d76f3dcc 5242:f3eca926258e
3749 fn)) 3749 fn))
3750 (mapcar #'quote-maybe constants) 3750 (mapcar #'quote-maybe constants)
3751 :test #'equal)) 3751 :test #'equal))
3752 ,stack-depth)))) 3752 ,stack-depth))))
3753 3753
3754 (define-compiler-macro concatenate (&whole form type &rest seqs)
3755 (if (and (cl-const-expr-p type) (memq (cl-const-expr-val type)
3756 '(vector bit-vector list string)))
3757 (case (cl-const-expr-val type)
3758 (list (append (list 'append) (cddr form) '(nil)))
3759 (vector (cons 'vconcat (cddr form)))
3760 (bit-vector (cons 'bvconcat (cddr form)))
3761 (string (cons 'concat (cddr form))))
3762 form))
3763
3754 (mapc 3764 (mapc
3755 #'(lambda (y) 3765 #'(lambda (y)
3756 (put (car y) 'side-effect-free t) 3766 (put (car y) 'side-effect-free t)
3757 (put (car y) 'byte-compile 'cl-byte-compile-compiler-macro) 3767 (put (car y) 'byte-compile 'cl-byte-compile-compiler-macro)
3758 (put (car y) 'cl-compiler-macro 3768 (put (car y) 'cl-compiler-macro