]> git.eshelyaron.com Git - emacs.git/commitdiff
Minor renaming of internal CL functions and variables.
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 17 May 2012 20:04:56 +0000 (16:04 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 17 May 2012 20:04:56 +0000 (16:04 -0400)
* lisp/emacs-lisp/cl-seq.el (cl--adjoin): Rename from cl-adjoin.
(cl--position): Rename from cl-position.
(cl--delete-duplicates): Rename from cl-delete-duplicates.
* lisp/emacs-lisp/cl.el (cl--gensym-counter): Rename from *gensym-counter*.
(cl--random-state): Rename from *random-state*.

lisp/ChangeLog
lisp/emacs-lisp/cl-extra.el
lisp/emacs-lisp/cl-loaddefs.el
lisp/emacs-lisp/cl-macs.el
lisp/emacs-lisp/cl-seq.el
lisp/emacs-lisp/cl.el

index fca6543072cc1357690b102d0b0d0fac82e328c9..3981911d99b60a5f7666805e9e62e1e2685bcad9 100644 (file)
@@ -1,3 +1,12 @@
+2012-05-17  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       Minor renaming of internal CL functions and variables.
+       * emacs-lisp/cl-seq.el (cl--adjoin): Rename from cl-adjoin.
+       (cl--position): Rename from cl-position.
+       (cl--delete-duplicates): Rename from cl-delete-duplicates.
+       * emacs-lisp/cl.el (cl--gensym-counter): Rename from *gensym-counter*.
+       (cl--random-state): Rename from *random-state*.
+
 2012-05-17  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * emacs-lisp/cl-macs.el (cl-transform-lambda): Don't add spurious
index 9a3d8cf705b23a880261b2c5850d705e368b6793..420480d16eacf86ee428c6a00487c0620e1ecd3f 100644 (file)
@@ -434,7 +434,7 @@ With two arguments, return rounding and remainder of their quotient."
 (defun random* (lim &optional state)
   "Return a random nonnegative number less than LIM, an integer or float.
 Optional second arg STATE is a random-state object."
-  (or state (setq state *random-state*))
+  (or state (setq state cl--random-state))
   ;; Inspired by "ran3" from Numerical Recipes.  Additive congruential method.
   (let ((vec (aref state 3)))
     (if (integerp vec)
@@ -457,9 +457,9 @@ Optional second arg STATE is a random-state object."
 
 ;;;###autoload
 (defun make-random-state (&optional state)
-  "Return a copy of random-state STATE, or of `*random-state*' if omitted.
+  "Return a copy of random-state STATE, or of the internal state if omitted.
 If STATE is t, return a new state object seeded from the time of day."
-  (cond ((null state) (make-random-state *random-state*))
+  (cond ((null state) (make-random-state cl--random-state))
        ((vectorp state) (cl-copy-tree state t))
        ((integerp state) (vector 'cl-random-state-tag -1 30 state))
        (t (make-random-state (cl-random-time)))))
index 06c8fe8dba740383b42903349eb219799fabc768..a00b4550b319607127004e504f6a8cfce97714a4 100644 (file)
@@ -10,7 +10,7 @@
 ;;;;;;  ceiling* floor* isqrt lcm gcd cl-progv-before cl-set-frame-visible-p
 ;;;;;;  cl-map-overlays cl-map-intervals cl-map-keymap-recursively
 ;;;;;;  notevery notany every some mapcon mapcan mapl maplist map
-;;;;;;  cl-mapcar-many equalp coerce) "cl-extra" "cl-extra.el" "5a8a7f7ec2dc453113b8cbda577f2acb")
+;;;;;;  cl-mapcar-many equalp coerce) "cl-extra" "cl-extra.el" "1a3a04c6a0286373093bea4b9bcf2e91")
 ;;; Generated autoloads from cl-extra.el
 
 (autoload 'coerce "cl-extra" "\
@@ -169,7 +169,7 @@ Optional second arg STATE is a random-state object.
 \(fn LIM &optional STATE)" nil nil)
 
 (autoload 'make-random-state "cl-extra" "\
-Return a copy of random-state STATE, or of `*random-state*' if omitted.
+Return a copy of random-state STATE, or of the internal state if omitted.
 If STATE is t, return a new state object seeded from the time of day.
 
 \(fn &optional STATE)" nil nil)
@@ -286,7 +286,7 @@ This also does some trivial optimizations to make the form prettier.
 ;;;;;;  flet progv psetq do-all-symbols do-symbols dotimes dolist
 ;;;;;;  do* do loop return-from return block etypecase typecase ecase
 ;;;;;;  case load-time-value eval-when destructuring-bind function*
-;;;;;;  defmacro* defun* gentemp gensym) "cl-macs" "cl-macs.el" "e10ebd95224fcfbe6a5edc59f40d695a")
+;;;;;;  defmacro* defun* gentemp gensym) "cl-macs" "cl-macs.el" "69ccd3344cea28acc44dd28eca07292f")
 ;;; Generated autoloads from cl-macs.el
 
 (autoload 'gensym "cl-macs" "\
@@ -764,13 +764,13 @@ surrounded by (block NAME ...).
 ;;;;;;  nsubst subst-if-not subst-if subsetp nset-exclusive-or set-exclusive-or
 ;;;;;;  nset-difference set-difference nintersection intersection
 ;;;;;;  nunion union rassoc-if-not rassoc-if rassoc* assoc-if-not
-;;;;;;  assoc-if assoc* cl-adjoin member-if-not member-if member*
+;;;;;;  assoc-if assoc* cl--adjoin member-if-not member-if member*
 ;;;;;;  merge stable-sort sort* search mismatch count-if-not count-if
 ;;;;;;  count position-if-not position-if position find-if-not find-if
 ;;;;;;  find nsubstitute-if-not nsubstitute-if nsubstitute substitute-if-not
 ;;;;;;  substitute-if substitute delete-duplicates remove-duplicates
 ;;;;;;  delete-if-not delete-if delete* remove-if-not remove-if remove*
-;;;;;;  replace fill reduce) "cl-seq" "cl-seq.el" "99095e49c83af1c8bec0fdcf517b3f95")
+;;;;;;  replace fill reduce) "cl-seq" "cl-seq.el" "2d8563fcbdf4bc77e569d0aeb0a35cfc")
 ;;; Generated autoloads from cl-seq.el
 
 (autoload 'reduce "cl-seq" "\
@@ -1047,7 +1047,7 @@ Keywords supported:  :key
 
 \(fn PREDICATE LIST [KEYWORD VALUE]...)" nil nil)
 
-(autoload 'cl-adjoin "cl-seq" "\
+(autoload 'cl--adjoin "cl-seq" "\
 
 
 \(fn CL-ITEM CL-LIST &rest CL-KEYS)" nil nil)
index 66fafb9ba4110aa6ccb97e40ca24db94e71d9520..6ca5e6294d6c53f1c6fc0364af5b8dc72ff1fe70 100644 (file)
 
 ;;; Symbols.
 
-(defvar *gensym-counter*)
+(defvar cl--gensym-counter)
 ;;;###autoload
 (defun gensym (&optional prefix)
   "Generate a new uninterned symbol.
 The name is made by appending a number to PREFIX, default \"G\"."
   (let ((pfix (if (stringp prefix) prefix "G"))
        (num (if (integerp prefix) prefix
-              (prog1 *gensym-counter*
-                (setq *gensym-counter* (1+ *gensym-counter*))))))
+              (prog1 cl--gensym-counter
+                (setq cl--gensym-counter (1+ cl--gensym-counter))))))
     (make-symbol (format "%s%d" pfix num))))
 
 ;;;###autoload
@@ -184,8 +184,8 @@ The name is made by appending a number to PREFIX, default \"G\"."
 The name is made by appending a number to PREFIX, default \"G\"."
   (let ((pfix (if (stringp prefix) prefix "G"))
        name)
-    (while (intern-soft (setq name (format "%s%d" pfix *gensym-counter*)))
-      (setq *gensym-counter* (1+ *gensym-counter*)))
+    (while (intern-soft (setq name (format "%s%d" pfix cl--gensym-counter)))
+      (setq cl--gensym-counter (1+ cl--gensym-counter)))
     (intern name)))
 
 
index f1890fbccf66596e339e2e76c1dc3a9279662d6b..233f0c83a6e392a1edd9581a27b8eeaa22b1e30d 100644 (file)
@@ -213,8 +213,8 @@ to avoid corrupting the original SEQ.
     (if (<= (or cl-count (setq cl-count 8000000)) 0)
        cl-seq
       (if (or (nlistp cl-seq) (and cl-from-end (< cl-count 4000000)))
-         (let ((cl-i (cl-position cl-item cl-seq cl-start cl-end
-                                  cl-from-end)))
+         (let ((cl-i (cl--position cl-item cl-seq cl-start cl-end
+                                    cl-from-end)))
            (if cl-i
                (let ((cl-res (apply 'delete* cl-item (append cl-seq nil)
                                     (append (if cl-from-end
@@ -279,8 +279,8 @@ This is a destructive function; it reuses the storage of SEQ whenever possible.
          (if (and cl-from-end (< cl-count 4000000))
              (let (cl-i)
                (while (and (>= (setq cl-count (1- cl-count)) 0)
-                           (setq cl-i (cl-position cl-item cl-seq cl-start
-                                                   cl-end cl-from-end)))
+                           (setq cl-i (cl--position cl-item cl-seq cl-start
+                                                     cl-end cl-from-end)))
                  (if (= cl-i 0) (setq cl-seq (cdr cl-seq))
                    (let ((cl-tail (nthcdr (1- cl-i) cl-seq)))
                      (setcdr cl-tail (cdr (cdr cl-tail)))))
@@ -330,16 +330,16 @@ This is a destructive function; it reuses the storage of SEQ whenever possible.
   "Return a copy of SEQ with all duplicate elements removed.
 \nKeywords supported:  :test :test-not :key :start :end :from-end
 \n(fn SEQ [KEYWORD VALUE]...)"
-  (cl-delete-duplicates cl-seq cl-keys t))
+  (cl--delete-duplicates cl-seq cl-keys t))
 
 ;;;###autoload
 (defun delete-duplicates (cl-seq &rest cl-keys)
   "Remove all duplicate elements from SEQ (destructively).
 \nKeywords supported:  :test :test-not :key :start :end :from-end
 \n(fn SEQ [KEYWORD VALUE]...)"
-  (cl-delete-duplicates cl-seq cl-keys nil))
+  (cl--delete-duplicates cl-seq cl-keys nil))
 
-(defun cl-delete-duplicates (cl-seq cl-keys cl-copy)
+(defun cl--delete-duplicates (cl-seq cl-keys cl-copy)
   (if (listp cl-seq)
       (cl-parsing-keywords (:test :test-not :key (:start 0) :end :from-end :if)
          ()
@@ -348,8 +348,8 @@ This is a destructive function; it reuses the storage of SEQ whenever possible.
              (setq cl-end (- (or cl-end (length cl-seq)) cl-start))
              (while (> cl-end 1)
                (setq cl-i 0)
-               (while (setq cl-i (cl-position (cl-check-key (car cl-p))
-                                              (cdr cl-p) cl-i (1- cl-end)))
+               (while (setq cl-i (cl--position (cl-check-key (car cl-p))
+                                                (cdr cl-p) cl-i (1- cl-end)))
                  (if cl-copy (setq cl-seq (copy-sequence cl-seq)
                                    cl-p (nthcdr cl-start cl-seq) cl-copy nil))
                  (let ((cl-tail (nthcdr cl-i cl-p)))
@@ -360,14 +360,14 @@ This is a destructive function; it reuses the storage of SEQ whenever possible.
              cl-seq)
          (setq cl-end (- (or cl-end (length cl-seq)) cl-start))
          (while (and (cdr cl-seq) (= cl-start 0) (> cl-end 1)
-                     (cl-position (cl-check-key (car cl-seq))
-                                  (cdr cl-seq) 0 (1- cl-end)))
+                     (cl--position (cl-check-key (car cl-seq))
+                                    (cdr cl-seq) 0 (1- cl-end)))
            (setq cl-seq (cdr cl-seq) cl-end (1- cl-end)))
          (let ((cl-p (if (> cl-start 0) (nthcdr (1- cl-start) cl-seq)
                        (setq cl-end (1- cl-end) cl-start 1) cl-seq)))
            (while (and (cdr (cdr cl-p)) (> cl-end 1))
-             (if (cl-position (cl-check-key (car (cdr cl-p)))
-                              (cdr (cdr cl-p)) 0 (1- cl-end))
+             (if (cl--position (cl-check-key (car (cdr cl-p)))
+                                (cdr (cdr cl-p)) 0 (1- cl-end))
                  (progn
                    (if cl-copy (setq cl-seq (copy-sequence cl-seq)
                                      cl-p (nthcdr (1- cl-start) cl-seq)
@@ -376,7 +376,7 @@ This is a destructive function; it reuses the storage of SEQ whenever possible.
                (setq cl-p (cdr cl-p)))
              (setq cl-end (1- cl-end) cl-start (1+ cl-start)))
            cl-seq)))
-    (let ((cl-res (cl-delete-duplicates (append cl-seq nil) cl-keys nil)))
+    (let ((cl-res (cl--delete-duplicates (append cl-seq nil) cl-keys nil)))
       (if (stringp cl-seq) (concat cl-res) (vconcat cl-res)))))
 
 ;;;###autoload
@@ -391,7 +391,7 @@ to avoid corrupting the original SEQ.
     (if (or (eq cl-old cl-new)
            (<= (or cl-count (setq cl-from-end nil cl-count 8000000)) 0))
        cl-seq
-      (let ((cl-i (cl-position cl-old cl-seq cl-start cl-end)))
+      (let ((cl-i (cl--position cl-old cl-seq cl-start cl-end)))
        (if (not cl-i)
            cl-seq
          (setq cl-seq (copy-sequence cl-seq))
@@ -502,9 +502,9 @@ Return the index of the matching item, or nil if not found.
 \n(fn ITEM SEQ [KEYWORD VALUE]...)"
   (cl-parsing-keywords (:test :test-not :key :if :if-not
                        (:start 0) :end :from-end) ()
-    (cl-position cl-item cl-seq cl-start cl-end cl-from-end)))
+    (cl--position cl-item cl-seq cl-start cl-end cl-from-end)))
 
-(defun cl-position (cl-item cl-seq cl-start &optional cl-end cl-from-end)
+(defun cl--position (cl-item cl-seq cl-start &optional cl-end cl-from-end)
   (if (listp cl-seq)
       (let ((cl-p (nthcdr cl-start cl-seq)))
        (or cl-end (setq cl-end 8000000))
@@ -619,8 +619,8 @@ return nil if there are no matches.
             (cl-if nil) cl-pos)
        (setq cl-end2 (- cl-end2 (1- cl-len)))
        (while (and (< cl-start2 cl-end2)
-                   (setq cl-pos (cl-position cl-first cl-seq2
-                                             cl-start2 cl-end2 cl-from-end))
+                   (setq cl-pos (cl--position cl-first cl-seq2
+                                               cl-start2 cl-end2 cl-from-end))
                    (apply 'mismatch cl-seq1 cl-seq2
                           :start1 (1+ cl-start1) :end1 cl-end1
                           :start2 (1+ cl-pos) :end2 (+ cl-pos cl-len)
@@ -702,7 +702,7 @@ Return the sublist of LIST whose car matches.
   (apply 'member* nil cl-list :if-not cl-pred cl-keys))
 
 ;;;###autoload
-(defun cl-adjoin (cl-item cl-list &rest cl-keys)
+(defun cl--adjoin (cl-item cl-list &rest cl-keys)
   (if (cl-parsing-keywords (:key) t
        (apply 'member* (cl-check-key cl-item) cl-list cl-keys))
       cl-list
index 971024fcbba214cf42b673fb5f0a36ecab142ce5..2b56e8a9e4bda032a0f71f9bd232331e7cca8645 100644 (file)
@@ -304,7 +304,7 @@ definitions to shadow the loaded ones for use in file byte-compilation.
     (while (>= (decf i) 0) (setq v (+ (* v 3) (aref time i))))
     v))
 
-(defvar *gensym-counter* (* (logand (cl-random-time) 1023) 100))
+(defvar cl--gensym-counter (* (logand (cl-random-time) 1023) 100))
 
 
 ;;; Numbers.
@@ -331,7 +331,7 @@ always returns nil."
   "Return t if INTEGER is even."
   (eq (logand integer 1) 0))
 
-(defvar *random-state* (vector 'cl-random-state-tag -1 30 (cl-random-time)))
+(defvar cl--random-state (vector 'cl-random-state-tag -1 30 (cl-random-time)))
 
 (defconst most-positive-float nil
   "The largest value that a Lisp float can hold.
@@ -608,7 +608,7 @@ Otherwise, return LIST unmodified.
         (if (memq cl-item cl-list) cl-list (cons cl-item cl-list)))
        ((or (equal cl-keys '(:test equal)) (null cl-keys))
         (if (member cl-item cl-list) cl-list (cons cl-item cl-list)))
-       (t (apply 'cl-adjoin cl-item cl-list cl-keys))))
+       (t (apply 'cl--adjoin cl-item cl-list cl-keys))))
 
 (defun subst (cl-new cl-old cl-tree &rest cl-keys)
   "Substitute NEW for OLD everywhere in TREE (non-destructively).