emacs-devel
[Top][All Lists]
Advanced

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

url/url.el - should (require 'cl) be removed?


From: Cheng Gao
Subject: url/url.el - should (require 'cl) be removed?
Date: Fri, 14 Oct 2005 16:52:15 +0800
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (windows-nt)

url/url.el line 32-42:

,----
| (eval-when-compile (require 'cl))
| ;; Don't require CL at runtime if we can avoid it (Emacs 21).
| ;; Otherwise we need it for hashing functions.  `puthash' was never
| ;; defined in the Emacs 20 cl.el for some reason.
| (if (fboundp 'puthash)
|     nil                                       ; internal or CL is loaded
|   (defalias 'puthash 'cl-puthash)
|   (autoload 'cl-puthash "cl")
|   (autoload 'gethash "cl")
|   (autoload 'maphash "cl")
|   (autoload 'make-hash-table "cl"))
`----

As it explains, (require 'cl) is for hash functions. 

But now puthash/gethash/maphash/make-hash-table are all builtins. And in
fact in cl-extra.el line 607-627:
,----
| ;;; Hash tables.
| ;; This is just kept for compatibility with code byte-compiled by Emacs-20.
| 
| ;; No idea if this might still be needed.
| (defun cl-not-hash-table (x &optional y &rest z)
|   (signal 'wrong-type-argument (list 'cl-hash-table-p (or y x))))
| 
| (defvar cl-builtin-gethash (symbol-function 'gethash))
| (defvar cl-builtin-remhash (symbol-function 'remhash))
| (defvar cl-builtin-clrhash (symbol-function 'clrhash))
| (defvar cl-builtin-maphash (symbol-function 'maphash))
| 
| (defalias 'cl-gethash 'gethash)
| (defalias 'cl-puthash 'puthash)
| (defalias 'cl-remhash 'remhash)
| (defalias 'cl-clrhash 'clrhash)
| (defalias 'cl-maphash 'maphash)
| ;; These three actually didn't exist in Emacs-20.
| (defalias 'cl-make-hash-table 'make-hash-table)
| (defalias 'cl-hash-table-p 'hash-table-p)
| (defalias 'cl-hash-table-count 'hash-table-count)
`----
cl-* ones are in fact alias of builtins.

So I guess these lines in url.el should be removed.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]