Changeset 278
- Timestamp:
- Jan 13, 2004, 4:55:02 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/ccl/level-1/l1-utils.lisp (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ccl/level-1/l1-utils.lisp
r260 r278 279 279 (setf (type-predicate 'macptr) 'macptrp) 280 280 281 (defun null-or-handlep (arg) 282 (and (macptrp arg) 283 (or (%null-ptr-p arg) 284 (handlep arg)))) 285 286 (defun require-null-or-handlep (arg) 287 (if (null-or-handlep arg) 288 arg 289 (require-type arg '(satisfies null-or-handlep)))) 281 290 282 291 283 … … 309 301 (defun %check-extra-arguments (ptr) 310 302 (when (destructure-state.current ptr) 311 ( error "Extra arguments in ~s don't match lambda list ~s."312 (destructure-state.whole ptr) (destructure-state.lambda ptr))))303 (signal-program-error "Extra arguments in ~s don't match lambda list ~s." 304 (destructure-state.whole ptr) (destructure-state.lambda ptr)))) 313 305 314 306 (defun %keyword-present-p (keys keyword) … … 324 316 (signal-simple-program-error "Odd length keyword list: ~s" actual)))) 325 317 (setq allow-others (or allow-others (getf actual :allow-other-keys))) 326 (unless allow-others 327 (do* ((a actual (cddr a)) 328 (k (car a) (car a))) 329 ((null a)) 330 (unless (or (eq k :allow-other-keys) 331 (member k keys)) 332 (signal-simple-program-error "Unknown keyword argument ~s in ~s. ~&Valid keyword arguments are ~s." k actual keys))))) 318 (do* ((a actual (cddr a)) 319 (k (car a) (car a))) 320 ((null a)) 321 (unless (typep k 'symbol) 322 (signal-simple-program-error 323 "Invalid keyword argument ~s in ~s. ~&Valid keyword arguments are ~s." k actual keys)) 324 (unless (or allow-others 325 (eq k :allow-other-keys) 326 (member k keys)) 327 (signal-simple-program-error "Unknown keyword argument ~s in ~s. ~&Valid keyword arguments are ~s." k actual keys)))) 333 328 334 329 (%fhave 'set-macro-function #'%macro-have) ; redefined in sysutils. … … 450 445 (if pair 451 446 (if (eql item (car pair)) 452 (return pair)) 453 (report-bad-arg pair 'cons))) 447 (return pair)))) 454 448 (assq item list))) 455 449 … … 462 456 (if pair 463 457 (if (funcall test-fn item (car pair)) 464 (return pair)) 465 (report-bad-arg pair 'cons)))) 458 (return pair))))) 466 459 467 460 … … 475 468 (if pair 476 469 (if (not (funcall test-not-fn item (car pair))) 477 (return pair)) 478 (report-bad-arg pair 'cons)))) 470 (return pair))))) 479 471 480 472 (defun assoc (item list &key test test-not key) … … 492 484 (if pair 493 485 (if (funcall test item (funcall key (car pair))) 494 (return pair)) 495 (report-bad-arg pair 'cons))) 486 (return pair)))) 496 487 (dolist (pair list) 497 488 (if pair 498 489 (unless (funcall test-not item (funcall key (car pair))) 499 (return pair)) 500 (report-bad-arg pair 'cons))))))) 490 (return pair)))))))) 501 491 502 492 … … 851 841 (defun eval-constant (form) 852 842 (if (quoted-form-p form) (%cadr form) 853 (if (constant-symbol-p form) (symbol-value form)854 (if (self-evaluating-p form) form855 (report-bad-arg form '(satsifies constantp))))))843 (if (constant-symbol-p form) (symbol-value form) 844 (if (self-evaluating-p form) form 845 (report-bad-arg form '(satisfies constantp)))))) 856 846 857 847 ; SETQ'd above before we could DEFVAR.
Note:
See TracChangeset
for help on using the changeset viewer.
