File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
typed-racket-lib/typed-racket Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 741
741
[exact? (make-pred-ty -ExactNumber)]
742
742
[inexact? (make-pred-ty (Un -InexactReal -InexactImaginary -InexactComplex))]
743
743
[fixnum? (make-pred-ty -Fixnum)]
744
+ [fixnum-for-every-system? (asym-pred Univ B (-PS (-is-type 0 -Fixnum) -tt))]
744
745
[index? (make-pred-ty -Index)]
745
746
[positive? (-> -Real B : (-PS (-is-type 0 -PosReal) (-is-type 0 -NonPosReal)))]
746
747
[negative? (-> -Real B : (-PS (-is-type 0 -NegReal) (-is-type 0 -NonNegReal)))]
Original file line number Diff line number Diff line change 8
8
(rep rep-utils base-type-rep type-mask core-rep)
9
9
(types numeric-predicates)
10
10
racket/unsafe/ops
11
+ racket/fixnum
11
12
;; For base type contracts
12
13
(for-template racket/base racket/contract/base (types numeric-predicates)))
13
14
21
22
nbits-union
22
23
nbits-subtract)
23
24
24
- ;; Is the number a fixnum on *all* the platforms Racket supports? This
25
- ;; works because Racket compiles only on 32+ bit systems. This check is
25
+ ;; Is the number a fixnum on *all* the platforms Racket supports? This check is
26
26
;; done at compile time to typecheck literals -- so use it instead of
27
27
;; `fixnum?' to avoid creating platform-dependent .zo files.
28
28
(define (portable-fixnum? n)
29
- (and (exact-integer? n)
30
- (< n (expt 2 30 ))
31
- (>= n (- (expt 2 30 )))))
32
- ;; same, for indexes
29
+ (fixnum-for-every-system? n))
30
+ ;; same, for indexes; Racket compiles only on 32+ bit systems
33
31
(define (portable-index? n)
34
32
(and (exact-integer? n)
35
33
(< n (expt 2 28 ))
You can’t perform that action at this time.
0 commit comments