comparison lisp/prim/subr.el @ 30:ec9a17fef872 r19-15b98

Import from CVS: tag r19-15b98
author cvs
date Mon, 13 Aug 2007 08:52:29 +0200
parents 441bb1e64a06
children 131b0175ea99
comparison
equal deleted inserted replaced
29:7976500f47f9 30:ec9a17fef872
467 (signal 'error (list (apply 'format args)))) 467 (signal 'error (list (apply 'format args))))
468 468
469 (defmacro check-argument-type (predicate argument) 469 (defmacro check-argument-type (predicate argument)
470 "Check that ARGUMENT satisfies PREDICATE. 470 "Check that ARGUMENT satisfies PREDICATE.
471 If not, signal a continuable `wrong-type-argument' error until the 471 If not, signal a continuable `wrong-type-argument' error until the
472 returned value satifies PREDICATE, and assign the returned value 472 returned value satisfies PREDICATE, and assign the returned value
473 to ARGUMENT." 473 to ARGUMENT."
474 `(if (not (,(eval predicate) ,argument)) 474 `(if (not (,(eval predicate) ,argument))
475 (setq ,argument 475 (setq ,argument
476 (wrong-type-argument ,predicate ,argument)))) 476 (wrong-type-argument ,predicate ,argument))))
477 477
561 561
562 ;; This was not present before. I think Jamie had some objections 562 ;; This was not present before. I think Jamie had some objections
563 ;; to this, so I'm leaving this undefined for now. --ben 563 ;; to this, so I'm leaving this undefined for now. --ben
564 564
565 ;;; The objection is this: there is more than one way to load the same file. 565 ;;; The objection is this: there is more than one way to load the same file.
566 ;;; "foo", "foo.elc", "foo.el", and "/some/path/foo.elc" are all differrent 566 ;;; "foo", "foo.elc", "foo.el", and "/some/path/foo.elc" are all different
567 ;;; ways to load the exact same code. `eval-after-load' is too stupid to 567 ;;; ways to load the exact same code. `eval-after-load' is too stupid to
568 ;;; deal with this sort of thing. If this sort of feature is desired, then 568 ;;; deal with this sort of thing. If this sort of feature is desired, then
569 ;;; it should work off of a hook on `provide'. Features are unique and 569 ;;; it should work off of a hook on `provide'. Features are unique and
570 ;;; the arguments to (load) are not. --Stig 570 ;;; the arguments to (load) are not. --Stig
571 571