comparison lisp/cl-macs.el @ 5632:bd80d9103fc8

Integrate CL code better into core, remove obsolete compatibility code. lisp/ChangeLog addition: 2011-12-30 Aidan Kehoe <kehoea@parhasard.net> * bytecomp.el: Call #'cl-compile-time-init explicitly here, don't rely on bytecomp-load-hook for what is core functionality. * cl-extra.el: * cl-extra.el (require): * cl-extra.el (make-random-state): * cl-extra.el (random-state-p): * cl-extra.el (make-hashtable): Removed. * cl-extra.el (make-weak-hashtable): Removed. * cl-extra.el (make-key-weak-hashtable): Removed. * cl-extra.el (make-value-weak-hashtable): Removed. * cl-extra.el ('hashtablep): Removed. * cl-extra.el ('hashtable-fullness): Removed. * cl-extra.el ('hashtable-test-function): Removed. * cl-extra.el ('hashtable-type): Removed. * cl-extra.el ('hashtable-size): Removed. * cl-extra.el ('copy-hashtable): Removed. * cl-extra.el (cl-builtin-gethash): Removed. * cl-extra.el (cl-builtin-remhash): Removed. * cl-extra.el (cl-builtin-clrhash): Removed. * cl-extra.el (cl-builtin-maphash): Removed. * cl-extra.el ('cl-gethash): Removed. * cl-extra.el ('cl-puthash): Removed. * cl-extra.el ('cl-remhash): Removed. * cl-extra.el ('cl-clrhash): Removed. * cl-extra.el ('cl-maphash): Removed. * cl-extra.el ('cl-make-hash-table): Removed. * cl-extra.el ('cl-hash-table-p): Removed. * cl-extra.el ('cl-hash-table-count): Removed. * cl-extra.el (cl-prettyexpand): * cl-extra.el (names): Remove compatibility aliases from this file. In #'cl-prettyexpand, if FULL is nil, don't expand return-from either, for symmetry with not expanding block. Drop cl-extra-load-hook, it's useless when cl-extra is dumped (since third-party code can't use it, and dumped code shouldn't use it.) * cl-macs.el: * cl-macs.el (cl-pop2): * cl-macs.el (defun*): * cl-macs.el (cl-parse-loop-clause): Remove some no-longer-needed compatibility kludges. * cl.el: * cl.el ('cl-map-extents): Removed. * cl.el (cl-random-time): * cl.el (list*): New, moved back from subr.el, given a shorter implementation. * cl.el ('cl-member): Removed. * cl.el ('cl-floor): Removed. * cl.el ('cl-ceiling): Removed. * cl.el ('cl-truncate): Removed. * cl.el ('cl-round): Removed. * cl.el ('cl-mod): Removed. Remove some compatibility aliases; these may conflict with package usage, in which case the packages need to be updated, the new names are available in 21.4, and that's the most recent version we support. * cl.el (cl-hacked-flag): Removed. * cl.el (cl-hack-byte-compiler): Removed. * subr.el: * subr.el (list*): Moved back to cl.el. * update-elc-2.el (batch-update-elc-2): * update-elc.el (do-autoload-commands): Add an autoload for cl-compile-time-init in these two files, they run on bare temacs, auto-autoload isn't available to them, and now bytecomp calls cl-compile-time-init explicitly. * cl-compat.el: Removed. This file was long obsolete. man/ChangeLog addition: 2011-12-30 Aidan Kehoe <kehoea@parhasard.net> * cl.texi (Top): * cl.texi (Usage): * cl.texi (Organization): * cl.texi (Efficiency Concerns): * cl.texi (Common Lisp Compatibility): Remove documentation of cl-compat, now it's deleted.
author Aidan Kehoe <kehoea@parhasard.net>
date Fri, 30 Dec 2011 16:05:31 +0000
parents c39052c921b5
children ae2fdb1fd9e0
comparison
equal deleted inserted replaced
5631:5e256f495401 5632:bd80d9103fc8
43 ;; See cl.el for Change Log. 43 ;; See cl.el for Change Log.
44 44
45 45
46 ;;; Code: 46 ;;; Code:
47 47
48 (or (memq 'cl-19 features)
49 (error "Tried to load `cl-macs' before `cl'!"))
50
51
52 (defmacro cl-pop2 (place) 48 (defmacro cl-pop2 (place)
53 (list 'prog1 (list 'car (list 'cdr place)) 49 (list 'prog1 (list 'car (list 'cdr place))
54 (list 'setq place (list 'cdr (list 'cdr place))))) 50 (list 'setq place (list 'cdr (list 'cdr place)))))
55 (put 'cl-pop2 'edebug-form-spec 'edebug-sexps) 51 (put 'cl-pop2 'edebug-form-spec 'edebug-sexps)
56 52
57 (defvar cl-optimize-safety) 53 (defvar cl-optimize-safety)
58 (defvar cl-optimize-speed) 54 (defvar cl-optimize-speed)
59
60
61 ;;; This kludge allows macros which use cl-transform-function-property
62 ;;; to be called at compile-time.
63
64 (require
65 (progn
66 (or (fboundp 'cl-transform-function-property)
67 (defalias 'cl-transform-function-property
68 #'(lambda (n p f)
69 (list 'put (list 'quote n) (list 'quote p)
70 (list 'function (cons 'lambda f))))))
71 'xemacs))
72
73 55
74 ;;; Initialization. 56 ;;; Initialization.
75 57
76 (defvar cl-old-bc-file-form nil) 58 (defvar cl-old-bc-file-form nil)
77 59
189 171
190 -- The format of the arguments to &optional is expanded: As well as simple 172 -- The format of the arguments to &optional is expanded: As well as simple
191 variables, they can be lists of the form (VAR [INITFORM [SVAR]]); when 173 variables, they can be lists of the form (VAR [INITFORM [SVAR]]); when
192 no argument is available for VAR, INITFORM is evaluated (or nil, if 174 no argument is available for VAR, INITFORM is evaluated (or nil, if
193 INITFORM is omitted) and stored as VAR's value, and SVAR is bound to t. 175 INITFORM is omitted) and stored as VAR's value, and SVAR is bound to t.
194 If an arguent is available for VAR, and INITFORM is unused, SVAR is 176 If an argument is available for VAR, and INITFORM is unused, SVAR is
195 bound to nil. 177 bound to nil.
196 178
197 -- &key specifies keyword arguments. The format of each argument is 179 -- &key specifies keyword arguments. The format of each argument is
198 VAR || ( { VAR || (KEYWORD VAR) } [INITFORM [SVAR]]). 180 VAR || ( { VAR || (KEYWORD VAR) } [INITFORM [SVAR]]).
199 181
1304 (while (memq (car args) '(in of from to)) 1286 (while (memq (car args) '(in of from to))
1305 (cond ((eq (car args) 'from) (setq from (cl-pop2 args))) 1287 (cond ((eq (car args) 'from) (setq from (cl-pop2 args)))
1306 ((eq (car args) 'to) (setq to (cl-pop2 args))) 1288 ((eq (car args) 'to) (setq to (cl-pop2 args)))
1307 (t (setq buf (cl-pop2 args))))) 1289 (t (setq buf (cl-pop2 args)))))
1308 (setq loop-map-form 1290 (setq loop-map-form
1309 (list 'cl-map-extents 1291 (list 'map-extents
1310 (list 'function (list 'lambda (list var (gensym)) 1292 (list 'function (list 'lambda (list var (gensym))
1311 '(progn . --cl-map) nil)) 1293 '(progn . --cl-map) nil))
1312 buf from to)))) 1294 buf from to))))
1313 1295
1314 ((memq word '(interval intervals)) 1296 ((memq word '(interval intervals))