code.
(Internally, the variable @code{cl--gensym-counter} holds the counter
-used to generate names. It is incremented after each use. In Common
-Lisp this is initialized with 0, but this package initializes it with
-a random time-dependent value to avoid trouble when two files that
-each used @code{cl-gensym} in their compilation are loaded together.
-Uninterned symbols become interned when the compiler writes them out
-to a file and the Emacs loader loads them, so their names have to be
-treated a bit more carefully than in Common Lisp where uninterned
-symbols remain uninterned after loading.)
+used to generate names. It is initialized with zero and incremented
+after each use.)
@end defun
@defun cl-gentemp &optional x
advisory in Emacs Lisp, do not rigorously obey the scoping rules
set down in Steele's book.
-The variable @code{cl--gensym-counter} starts out with a pseudo-random
-value rather than with zero. This is to cope with the fact that
-generated symbols become interned when they are written to and
-loaded back from a file.
+The variable @code{cl--gensym-counter} starts out with zero.
The @code{cl-defstruct} facility is compatible, except that structures
are of type @code{:type vector :named} by default rather than some
`(progn ,@body)))) ; Avoid loading cl-macs.el for cl-eval-when.
-;;; Symbols.
-
-(defun cl--random-time ()
- (let* ((time (copy-sequence (current-time-string))) (i (length time)) (v 0))
- (while (>= (cl-decf i) 0) (setq v (+ (* v 3) (aref time i))))
- v))
-
-(defvar cl--gensym-counter (* (logand (cl--random-time) 1023) 100))
-
-
;;; Numbers.
(define-obsolete-function-alias 'cl-floatp-safe 'floatp "24.4")
(let ((n (aref cl-digit-char-table char)))
(and n (< n (or radix 10)) n)))
+(defun cl--random-time ()
+ (let* ((time (copy-sequence (current-time-string))) (i (length time)) (v 0))
+ (while (>= (cl-decf i) 0) (setq v (+ (* v 3) (aref time i))))
+ v))
+
(defvar cl--random-state
(vector 'cl--random-state-tag -1 30 (cl--random-time)))