1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-07 06:50:23 -08:00

* Order function types in aphabetical order

* lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Reorder in
	aphabetical order and comment.
This commit is contained in:
Andrea Corallo 2020-12-30 13:50:23 +01:00
parent 0593f47876
commit db2a49327a

View file

@ -185,133 +185,112 @@ Useful to hook into pass checkers.")
;; FIXME this probably should not be here but... good for now.
(defconst comp-known-type-specifiers
`(
;; pure-fns
(cons (function (t t) cons))
(car (function (list) t))
(cdr (function (list) t))
(1+ (function ((or number marker)) number))
(1- (function ((or number marker)) number))
;; Functions we can trust not to be or if redefined should expose
;; the same type. Vast majority of these is either pure or
;; pritive, the original list is the union of pure +
;; side-effect-free-fns + side-effect-and-error-free-fns:
(% (function ((or number marker) (or number marker)) number))
(* (function (&rest (or number marker)) number))
(+ (function (&rest (or number marker)) number))
(- (function (&rest (or number marker)) number))
(* (function (&rest (or number marker)) number))
(/ (function ((or number marker) &rest (or number marker)) number))
(% (function ((or number marker) (or number marker)) number))
(concat (function (&rest sequence) string))
(regexp-opt (function (list) string))
(string-to-char (function (string) fixnum))
(symbol-name (function (symbol) string))
(eq (function (t t) boolean))
(eql (function (t t) boolean))
(= (function ((or number marker) &rest (or number marker)) boolean))
(/= (function ((or number marker) (or number marker)) boolean))
(1+ (function ((or number marker)) number))
(1- (function ((or number marker)) number))
(< (function ((or number marker) &rest (or number marker)) boolean))
(<= (function ((or number marker) &rest (or number marker)) boolean))
(>= (function ((or number marker) &rest (or number marker)) boolean))
(= (function ((or number marker) &rest (or number marker)) boolean))
(> (function ((or number marker) &rest (or number marker)) boolean))
(min (function ((or number marker) &rest (or number marker)) number))
(max (function ((or number marker) &rest (or number marker)) number))
(mod (function ((or number marker) (or number marker))
(or (integer 0 *) (float 0 *))))
(>= (function ((or number marker) &rest (or number marker)) boolean))
(abs (function (number) number))
(ash (function (integer integer) integer))
(sqrt (function (number) float))
(logand (function (&rest (or integer marker)) integer))
(logior (function (&rest (or integer marker)) integer))
(lognot (function (integer) integer))
(logxor (function (&rest (or integer marker)) integer))
(logcount (function (integer) integer))
(copysign (function (float float) float))
(isnan (function (float) boolean))
(ldexp (function (number integer) float))
(float (function (number) float))
(logb (function (number) integer))
(floor (function (number &optional number) integer))
(ceiling (function (number &optional number) integer))
(round (function (number &optional number) integer))
(truncate (function (number &optional number) integer))
(ffloor (function (float) float))
(fceiling (function (float) float))
(fround (function (float) float))
(ftruncate (function (float) float))
(string= (function ((or string symbol) (or string symbol)) boolean))
(string-equal (function ((or string symbol) (or string symbol)) boolean))
(string< (function ((or string symbol) (or string symbol)) boolean))
(string-lessp (function ((or string symbol) (or string symbol)) boolean))
(string-search (function (string string &optional integer) integer))
(string-to-number (function (string &optional integer) number))
(string-to-syntax (function (string) cons))
(substring (function ((or string vector) &optional integer integer)
(or string vector)))
(sxhash (function (t) integer))
(sxhash-equal (function (t) integer))
(sxhash-eq (function (t) integer))
(sxhash-eql (function (t) integer))
(symbol-function (function (symbol) t))
(symbol-plist (function (symbol) list))
(symbol-value (function (symbol) t))
(string-make-unibyte (function (string) string))
(string-make-multibyte (function (string) string))
(string-as-multibyte (function (string) string))
(string-as-unibyte (function (string) string))
(string-to-multibyte (function (string) string))
(tan (function (number) float))
(time-convert (function (t &optional (or boolean integer)) cons))
(unibyte-char-to-multibyte (function (fixnum) fixnum)) ;; byte is fixnum
(upcase (function ((or fixnum string)) (or fixnum string)))
(user-full-name (function (&optional integer) string))
(user-login-name (function (&optional integer) (or string null)))
(user-original-login-name (function (&optional integer) (or string null)))
(custom-variable-p (function (symbol) boolean))
(vconcat (function (&rest sequence) vector))
;; TODO all window-* :x
(zerop (function (number) boolean))
;; side-effect-free-fns
(acos (function (number) float))
(append (function (&rest list) list))
(aref (function (array fixnum) t))
(arrayp (function (t) boolean))
(ash (function (integer integer) integer))
(asin (function (number) float))
(assq (function (t list) list))
(atan (function (number &optional number) float))
(atom (function (t) boolean))
(bignump (function (t) boolean))
(bobp (function () boolean))
(bolp (function () boolean))
(bool-vector-count-consecutive (function (bool-vector bool-vector integer) fixnum))
(bool-vector-count-population (function (bool-vector) fixnum))
(bool-vector-not (function (bool-vector &optional bool-vector) bool-vector))
(bool-vector-p (function (t) boolean))
(bool-vector-subsetp (function (bool-vector bool-vector) boolean))
(boundp (function (symbol) boolean))
(buffer-end (function ((or number marker)) integer))
(buffer-file-name (function (&optional buffer) string))
(buffer-list (function (&optional frame) list))
(buffer-local-variables (function (&optional buffer) list))
(buffer-modified-p (function (&optional buffer) boolean))
(buffer-size (function (&optional buffer) integer))
(buffer-string (function () string))
(buffer-substring (function ((or integer marker) (or integer marker)) string))
(bufferp (function (t) boolean))
(byte-code-function-p (function (t) boolean))
(capitalize (function (or integer string) (or integer string)))
(car (function (list) t))
(car-less-than-car (function (list list) boolean))
(car-safe (function (t) t))
(case-table-p (function (t) boolean))
(cdr (function (list) t))
(cdr-safe (function (t) t))
(ceiling (function (number &optional number) integer))
(char-after (function (&optional (or marker integer)) fixnum))
(char-before (function (&optional (or marker integer)) fixnum))
(char-equal (function (integer integer) boolean))
(char-or-string-p (function (t) boolean))
(char-to-string (function (fixnum) string))
(char-width (function (fixnum) fixnum))
(compare-strings (function (string (or integer marker null)
(or integer marker null)
string (or integer marker null)
(or integer marker null)
&optional t)
(or (member t) fixnum)))
(characterp (function (t &optional t) boolean))
(charsetp (function (t) boolean))
(commandp (function (t &optional t) boolean))
(compare-strings (function (string (or integer marker null) (or integer marker null) string (or integer marker null) (or integer marker null) &optional t) (or (member t) fixnum)))
(concat (function (&rest sequence) string))
(cons (function (t t) cons))
(consp (function (t) boolean))
(coordinates-in-window-p (function (cons window) boolean))
(copy-alist (function (list) list))
(copy-sequence (function (sequence) sequence))
(copy-marker (function (&optional (or integer marker) boolean) marker))
(copy-sequence (function (sequence) sequence))
(copysign (function (float float) float))
(cos (function (number) float))
(count-lines (function ((or integer marker) (or integer marker) &optional t)
integer))
(count-lines (function ((or integer marker) (or integer marker) &optional t) integer))
(current-buffer (function () buffer))
(current-global-map (function () cons))
(current-indentation (function () integer))
(current-local-map (function () cons))
(current-minor-mode-maps (function () cons))
(current-time (function () cons))
(current-time-string (function (&optional string boolean) string))
(current-time-zone (function (&optional string boolean) cons))
(custom-variable-p (function (symbol) boolean))
(decode-char (function (cons t) (or fixnum null)))
(decode-time (function (&optional string symbol symbol) cons))
(default-boundp (function (symbol) boolean))
(default-value (function (symbol) t))
(documentation (function ((or function symbol subr) &optional t)
(or null string)))
(degrees-to-radians (function (number) float))
(documentation (function ((or function symbol subr) &optional t) (or null string)))
(downcase (function ((or fixnum string)) (or fixnum string)))
(elt (function (sequence integer) t))
(encode-char (function (fixnum symbol) (or fixnum null)))
(encode-time (function (cons &rest t) cons))
(eobp (function () boolean))
(eolp (function () boolean))
(eq (function (t t) boolean))
(eql (function (t t) boolean))
(equal (function (t t) boolean))
(error-message-string (function (list) string))
(eventp (function (t) boolean))
(exp (function (number) float))
(expt (function (number number) float))
(encode-time (function (cons &rest t) cons))
(error-message-string (function (list) string))
(fboundp (function (symbol) boolean))
(fceiling (function (float) float))
(featurep (function (symbol &optional symbol) boolean))
(ffloor (function (float) float))
(file-directory-p (function (string) boolean))
(file-exists-p (function (string) boolean))
(file-locked-p (function (string) boolean))
@ -320,174 +299,179 @@ Useful to hook into pass checkers.")
(file-readable-p (function (string) boolean))
(file-symlink-p (function (string) boolean))
(file-writable-p (function (string) boolean))
(fixnump (function (t) boolean))
(float (function (number) float))
(float-time (function (&optional cons) float))
(floatp (function (t) boolean))
(floor (function (number &optional number) integer))
(following-char (function () fixnum))
(format (function (string &rest t) string))
(format-time-string (function (string &optional cons symbol) string))
(frame-first-window (function ((or frame window)) window))
(frame-root-window (function (&optional (or frame window)) window))
(frame-selected-window (function (&optional (or frame window)) window))
(frame-visible-p (function (frame) boolean))
(framep (function (t) boolean))
(fround (function (float) float))
(ftruncate (function (float) float))
(get (function (symbol symbol) t))
(gethash (function (t hash-table &optional t) t))
(get-buffer (function ((or buffer string)) (or buffer null)))
(get-buffer-window (function (&optional (or buffer string)
(or symbol (integer 0 0)))
(or null window)))
(getenv (function (string &optional frame) (or null string)))
(get-buffer-window (function (&optional (or buffer string) (or symbol (integer 0 0))) (or null window)))
(get-file-buffer (function (string) (or null buffer)))
(hash-table-count (function (hash-table) integer))
(int-to-string (function (number) string))
(intern-soft (function (string &optional vector) symbol))
(keymap-parent (function (cons) (or cons null)))
(length< (function (sequence fixnum) boolean))
(length> (function (sequence fixnum) boolean))
(length= (function (sequence fixnum) boolean))
(line-beginning-position (function (&optional integer) integer))
(line-end-position (function (&optional integer) integer))
(local-variable-if-set-p (function (symbol &optional buffer) boolean))
(local-variable-p (function (symbol &optional buffer) boolean))
(locale-info (function ((member codeset days months paper))
(or null string)))
(log (function (number number) float))
(log10 (function (number) float))
;; (lsh (function ((integer ,most-negative-fixnum *) integer) integer)) ?
(lsh (function (integer integer) integer))
(make-byte-code (function ((or fixnum list) string vector integer &optional
string t &rest t)
vector))
(make-list (function (integer t) list))
(make-string (function (integer fixnum &optional t) string))
(make-symbol (function (string) symbol))
(marker-buffer (function (marker) buffer))
(minibuffer-selected-window (function () window))
(minibuffer-window (function (&optional frame) window))
(multibyte-char-to-unibyte (function (fixnum) fixnum))
(next-window (function (&optional window t t) window))
(number-to-string (function (number) string))
(parse-colon-path (function (string) cons))
(previous-window (function (&optional window t t) window))
(prin1-to-string (function (t &optional t) string))
(propertize (function (string &rest t) string))
(degrees-to-radians (function (number) float))
(radians-to-degrees (function (number) float))
(read-from-string (function (string &ptional integer integer) cons))
(region-beginning (function () integer))
(region-end (function () integer))
(reverse (function (sequence) sequence))
(sin (function (number) float))
(string (function (&rest fixnum) strng))
(get-largest-window (function (&optional t t t) window))
(get-lru-window (function (&optional t t t) window))
(one-window-p (function (&optional t t) boolean))
(regexp-quote (function (string) string))
(proper-list-p (function (t) integer))
(nth (function (integer list) t))
(nthcdr (function (integer list) list))
(last (function (list &optional integer) list))
(length (function (sequence) integer))
(memq (function (t list) list))
(memql (function (t list) list))
(member (function (t list) list))
(assq (function (t list) list))
(rassq (function (t list) list))
(rassoc (function (t list) list))
(plist-get (function (list t) t))
(lax-plist-get (function (list t) t))
(plist-member (function (list t) list))
(aref (function (array fixnum) t))
(elt (function (sequence integer) t))
(bool-vector-subsetp (function (bool-vector bool-vector) boolean))
(bool-vector-not (function (bool-vector &optional bool-vector) bool-vector))
(bool-vector-count-population (function (bool-vector) fixnum))
(bool-vector-count-consecutive (function (bool-vector bool-vector integer)
fixnum))
;; side-effect-and-error-free-fns
(arrayp (function (t) boolean))
(atom (function (t) boolean))
(bignump (function (t) boolean))
(bobp (function () boolean))
(bolp (function () boolean))
(bool-vector-p (function (t) boolean))
(buffer-end (function ((or number marker)) integer))
(buffer-list (function (&optional frame) list))
(buffer-size (function (&optional buffer) integer))
(buffer-string (function () string))
(bufferp (function (t) boolean))
(car-safe (function (t) t))
(case-table-p (function (t) boolean))
(cdr-safe (function (t) t))
(char-or-string-p (function (t) boolean))
(characterp (function (t &optional t) boolean))
(charsetp (function (t) boolean))
(commandp (function (t &optional t) boolean))
(consp (function (t) boolean))
(current-buffer (function () buffer))
(current-global-map (function () cons))
(current-indentation (function () integer))
(current-local-map (function () cons))
(current-minor-mode-maps (function () cons))
(current-time (function () cons))
(eobp (function () boolean))
(eolp (function () boolean))
(equal (function (t t) boolean))
(eventp (function (t) boolean))
(fixnump (function (t) boolean))
(floatp (function (t) boolean))
(following-char (function () fixnum))
(framep (function (t) boolean))
(getenv (function (string &optional frame) (or null string)))
(gethash (function (t hash-table &optional t) t))
(hash-table-count (function (hash-table) integer))
(hash-table-p (function (t) boolean))
(identity (function (t) t))
(ignore (function (&rest t) null))
(integerp (function (t) boolean))
(int-to-string (function (number) string))
(integer-or-marker-p (function (t) boolean))
(integerp (function (t) boolean))
(interactive-p (function () boolean))
(intern-soft (function (string &optional vector) symbol))
(invocation-directory (function () string))
(invocation-name (function () string))
(isnan (function (float) boolean))
(keymap-parent (function (cons) (or cons null)))
(keymapp (function (t) boolean))
(keywordp (function (t) boolean))
(last (function (list &optional integer) list))
(lax-plist-get (function (list t) t))
(ldexp (function (number integer) float))
(length (function (sequence) integer))
(length< (function (sequence fixnum) boolean))
(length= (function (sequence fixnum) boolean))
(length> (function (sequence fixnum) boolean))
(line-beginning-position (function (&optional integer) integer))
(line-end-position (function (&optional integer) integer))
(list (function (&rest t) list))
(listp (function (t) boolean))
(local-variable-if-set-p (function (symbol &optional buffer) boolean))
(local-variable-p (function (symbol &optional buffer) boolean))
(locale-info (function ((member codeset days months paper)) (or null string)))
(log (function (number number) float))
(log10 (function (number) float))
(logand (function (&rest (or integer marker)) integer))
(logb (function (number) integer))
(logcount (function (integer) integer))
(logior (function (&rest (or integer marker)) integer))
(lognot (function (integer) integer))
(logxor (function (&rest (or integer marker)) integer))
;; (lsh (function ((integer ,most-negative-fixnum *) integer) integer)) ?
(lsh (function (integer integer) integer))
(make-byte-code (function ((or fixnum list) string vector integer &optional string t &rest t) vector))
(make-list (function (integer t) list))
(make-marker (function () marker))
(make-string (function (integer fixnum &optional t) string))
(make-symbol (function (string) symbol))
(mark (function (&optional t) (or integer null)))
(mark-marker (function () marker))
(marker-buffer (function (marker) buffer))
(markerp (function (t) boolean))
(max (function ((or number marker) &rest (or number marker)) number))
(max-char (function () fixnum))
(member (function (t list) list))
(memory-limit (function () integer))
(memq (function (t list) list))
(memql (function (t list) list))
(min (function ((or number marker) &rest (or number marker)) number))
(minibuffer-selected-window (function () window))
(minibuffer-window (function (&optional frame) window))
(mod (function ((or number marker) (or number marker)) (or (integer 0 *) (float 0 *))))
(mouse-movement-p (function (t) boolean))
(multibyte-char-to-unibyte (function (fixnum) fixnum))
(natnump (function (t) boolean))
(next-window (function (&optional window t t) window))
(nlistp (function (t) boolean))
(not (function (t) boolean))
(nth (function (integer list) t))
(nthcdr (function (integer list) list))
(null (function (t) boolean))
(number-or-marker-p (function (t) boolean))
(number-to-string (function (number) string))
(numberp (function (t) boolean))
(one-window-p (function (&optional t t) boolean))
(overlayp (function (t) boolean))
(parse-colon-path (function (string) cons))
(plist-get (function (list t) t))
(plist-member (function (list t) list))
(point (function () integer))
(point-marker (function () marker))
(point-min (function () integer))
(point-max (function () integer))
(point-min (function () integer))
(preceding-char (function () fixnum))
(previous-window (function (&optional window t t) window))
(prin1-to-string (function (t &optional t) string))
(processp (function (t) boolean))
(proper-list-p (function (t) integer))
(propertize (function (string &rest t) string))
(radians-to-degrees (function (number) float))
(rassoc (function (t list) list))
(rassq (function (t list) list))
(read-from-string (function (string &ptional integer integer) cons))
(recent-keys (function (&optional (or cons null)) vector))
(recursion-depth (function () integer))
(regexp-opt (function (list) string))
(regexp-quote (function (string) string))
(region-beginning (function () integer))
(region-end (function () integer))
(reverse (function (sequence) sequence))
(round (function (number &optional number) integer))
(safe-length (function (t) integer))
(selected-frame (function () frame))
(selected-window (function () window))
(sequencep (function (t) boolean))
(sin (function (number) float))
(sqrt (function (number) float))
(standard-case-table (function () char-table))
(standard-syntax-table (function () char-table))
(string (function (&rest fixnum) strng))
(string-as-multibyte (function (string) string))
(string-as-unibyte (function (string) string))
(string-equal (function ((or string symbol) (or string symbol)) boolean))
(string-lessp (function ((or string symbol) (or string symbol)) boolean))
(string-make-multibyte (function (string) string))
(string-make-unibyte (function (string) string))
(string-search (function (string string &optional integer) integer))
(string-to-char (function (string) fixnum))
(string-to-multibyte (function (string) string))
(string-to-number (function (string &optional integer) number))
(string-to-syntax (function (string) cons))
(string< (function ((or string symbol) (or string symbol)) boolean))
(string= (function ((or string symbol) (or string symbol)) boolean))
(stringp (function (t) boolean))
(subrp (function (t) boolean))
(substring (function ((or string vector) &optional integer integer) (or string vector)))
(sxhash (function (t) integer))
(sxhash-eq (function (t) integer))
(sxhash-eql (function (t) integer))
(sxhash-equal (function (t) integer))
(symbol-function (function (symbol) t))
(symbol-name (function (symbol) string))
(symbol-plist (function (symbol) list))
(symbol-value (function (symbol) t))
(symbolp (function (t) boolean))
(syntax-table (function () char-table))
(syntax-table-p (function (t) boolean))
(tan (function (number) float))
(this-command-keys (function () string))
(this-command-keys-vector (function () vector))
(this-single-command-keys (function () vector))
(this-single-command-raw-keys (function () vector))
(time-convert (function (t &optional (or boolean integer)) cons))
(truncate (function (number &optional number) integer))
(type-of (function (t) symbol))
(unibyte-char-to-multibyte (function (fixnum) fixnum)) ;; byte is fixnum
(upcase (function ((or fixnum string)) (or fixnum string)))
(user-full-name (function (&optional integer) string))
(user-login-name (function (&optional integer) (or string null)))
(user-original-login-name (function (&optional integer) (or string null)))
(user-real-login-name (function () string))
(user-real-uid (function () integer))
(user-uid (function () integer))
(vconcat (function (&rest sequence) vector))
(vector (function (&rest t) vector))
(vectorp (function (t) boolean))
(visible-frame-list (function () list))
@ -496,6 +480,7 @@ Useful to hook into pass checkers.")
(window-live-p (function (t) boolean))
(window-valid-p (function (t) boolean))
(windowp (function (t) boolean))
(zerop (function (number) boolean))
;; Type hints
(comp-hint-fixnum (function (t) fixnum))
(comp-hint-cons (function (t) cons))