• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/emacs-lisp/

Lines Matching +defs:file +defs:type

10 ;; This file is part of GNU Emacs.
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
38 ;; This file contains the portions of the Common Lisp extensions
40 ;; if the compiler or interpreter is used---this file is not
76 (defvar cl-old-bc-file-form nil)
292 (safety (if (cl-compiling-file) cl-optimize-safety 3))
445 (if (and (fboundp 'cl-compiling-file) (cl-compiling-file)
472 (if (cl-compiling-file)
475 (if (and (fboundp 'byte-compile-file-form-defmumble)
477 (fset 'byte-compile-file-form
479 (list 'fset '(quote byte-compile-file-form)
481 (symbol-function 'byte-compile-file-form)))
482 (list 'byte-compile-file-form (list 'quote set))
483 '(byte-compile-file-form form)))
539 (type-list nil)
548 temp (list 'quote (reverse type-list))))
550 (push (car c) type-list)
551 (cl-make-type-test temp (car c))))
1310 (if (and (cl-compiling-file)
1481 (defmacro the (type form) form)
1536 (if (cl-compiling-file)
1682 (defsetf buffer-file-name set-visited-file-name t)
1698 (defsetf default-file-modes set-default-file-modes t)
1717 (defsetf file-modes set-file-modes t)
1759 (defsetf visited-file-modtime set-visited-file-modtime t)
2138 "Define a struct type.
2139 This macro defines a new Lisp data type called NAME, which contains data
2154 (safety (if (cl-compiling-file) cl-optimize-safety 3))
2160 (type nil)
2198 ((eq opt :type)
2199 (setq type (car args)))
2211 (or type (and include (not (get include 'cl-struct-print)))
2213 print-func (and (or (not (or include type)) (null print-func))
2218 (let ((inc-type (get include 'cl-struct-type))
2220 (or inc-type (error "%s is not a struct name" include))
2221 (and type (not (eq (car inc-type) type))
2222 (error ":type disagrees with :include for %s" name))
2230 type (car inc-type)
2232 (if (cadr inc-type) (setq tag name named t))
2239 (if type
2241 (or (memq type '(vector list))
2242 (error "Invalid :type specifier: %s" type))
2244 (setq type 'vector named 'true)))
2251 (if (eq type 'vector)
2287 (list (if (eq type 'vector) (list 'aref 'cl-x pos)
2333 (cons type make)) forms)
2347 (list 'put (list 'quote name) '(quote cl-struct-type)
2348 (list 'quote (list type (eq named t))))
2370 (list (if (eq (car (get name 'cl-struct-type)) 'vector)
2386 "Define NAME as a new data type.
2387 The type name can then be used in `typecase', `check-type', etc."
2392 (defun cl-make-type-test (val type)
2393 (if (symbolp type)
2394 (cond ((get type 'cl-deftype-handler)
2395 (cl-make-type-test val (funcall (get type 'cl-deftype-handler))))
2396 ((memq type '(nil t)) type)
2397 ((eq type 'null) `(null ,val))
2398 ((eq type 'atom) `(atom ,val))
2399 ((eq type 'float) `(floatp-safe ,val))
2400 ((eq type 'real) `(numberp ,val))
2401 ((eq type 'fixnum) `(integerp ,val))
2403 ((memq type '(character string-char)) `(char-valid-p ,val))
2405 (let* ((name (symbol-name type))
2409 (cond ((get (car type) 'cl-deftype-handler)
2410 (cl-make-type-test val (apply (get (car type) 'cl-deftype-handler)
2411 (cdr type))))
2412 ((memq (car type) '(integer float real number))
2413 (delq t (list 'and (cl-make-type-test val (car type))
2414 (if (memq (cadr type) '(* nil)) t
2415 (if (consp (cadr type)) (list '> val (caadr type))
2416 (list '>= val (cadr type))))
2417 (if (memq (caddr type) '(* nil)) t
2418 (if (consp (caddr type)) (list '< val (caaddr type))
2419 (list '<= val (caddr type)))))))
2420 ((memq (car type) '(and or not))
2421 (cons (car type)
2422 (mapcar (function (lambda (x) (cl-make-type-test val x)))
2423 (cdr type))))
2424 ((memq (car type) '(member member*))
2425 (list 'and (list 'member* val (list 'quote (cdr type))) t))
2426 ((eq (car type) 'satisfies) (list (cadr type) val))
2427 (t (error "Bad type spec: %s" type)))))
2429 (defun typep (object type) ; See compiler macro below.
2430 "Check that OBJECT is of type TYPE.
2431 TYPE is a Common Lisp-style type specifier."
2432 (eval (cl-make-type-test 'object type)))
2434 (defmacro check-type (form type &optional string)
2435 "Verify that FORM is of type TYPE; signal an error if not.
2436 STRING is an optional description of the desired type."
2437 (and (or (not (cl-compiling-file))
2441 (body (list 'or (cl-make-type-test temp type)
2442 (list 'signal '(quote wrong-type-argument)
2443 (list 'list (or string (list 'quote type))
2454 (and (or (not (cl-compiling-file))
2618 (define-compiler-macro typep (&whole form val type)
2619 (if (cl-const-expr-p type)
2620 (let ((res (cl-make-type-test val (cl-const-expr-val type))))