Changeset 39708 in project
- Timestamp:
- 03/14/21 21:03:12 (6 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
release/5/mailbox/trunk/inline-type-checks.scm
r39700 r39708 13 13 14 14 ;just in case older inlines 15 (define-inline ( %natural? n) (%<= 0 n))16 (define-inline ( %fxnatural? fx) (%fx<= 0 fx))15 (define-inline (natural? n) (<= 0 n)) 16 (define-inline (fxnatural? fx) (fx<= 0 fx)) 17 17 18 18 (cond-expand … … 42 42 43 43 (define-inline (%alist? obj) 44 (or ( %null? obj)45 (and ( %pair? obj) (%list-every/1 (lambda (x) (%pair? x)) obj))) )44 (or (null? obj) 45 (and (pair? obj) (%list-every/1 (lambda (x) (pair? x)) obj))) ) 46 46 47 47 ;; … … 67 67 68 68 (define-inline (%check-positive-fixnum loc obj . args) 69 (unless (and ( %fixnum? obj) (%fxpositive? obj))69 (unless (and (fixnum? obj) (fxpositive? obj)) 70 70 (error-positive-fixnum loc obj (optional args))) 71 71 obj ) 72 72 73 73 (define-inline (%check-natural-fixnum loc obj . args) 74 (unless (and ( %fixnum? obj) (%fxnatural? obj))74 (unless (and (fixnum? obj) (fxnatural? obj)) 75 75 (error-natural-fixnum loc obj (optional args))) 76 76 obj ) … … 79 79 80 80 (define-inline (%check-positive-integer loc obj . args) 81 (unless (and ( %integer? obj) (%positive? obj))81 (unless (and (integer? obj) (positive? obj)) 82 82 (error-positive-integer loc obj (optional args))) 83 83 obj ) 84 84 85 85 (define-inline (%check-natural-integer loc obj . args) 86 (unless (and ( %integer? obj) (%natural? obj))86 (unless (and (integer? obj) (natural? obj)) 87 87 (error-natural-integer loc obj (optional args))) 88 88 obj ) … … 91 91 92 92 (define-inline (%check-positive-number loc obj . args) 93 (unless (and ( %number? obj) (%positive? obj))93 (unless (and (number? obj) (positive? obj)) 94 94 (error-positive-number loc obj (optional args))) 95 95 obj ) 96 96 97 97 (define-inline (%check-natural-number loc obj . args) 98 (unless (and ( %number? obj) (%natural? obj))98 (unless (and (number? obj) (natural? obj)) 99 99 (error-natural-number loc obj (optional args))) 100 100 obj ) … … 110 110 111 111 (define-inline (%check-minimum-argument-count loc argc minargc) 112 (unless ( %fx<= minargc argc)112 (unless (fx<= minargc argc) 113 113 (error-minimum-argument-count loc argc minargc)) 114 114 argc ) 115 115 116 116 (define-inline (%check-argument-count loc argc maxargc) 117 (unless ( %fx<= argc maxargc)117 (unless (fx<= argc maxargc) 118 118 (error-argument-count loc argc maxargc)) 119 119 argc ) ) )
Note: See TracChangeset
for help on using the changeset viewer.