source: project/release/5/check-errors/trunk/type-errors-numbers.impl.scm @ 36490

Last change on this file since 36490 was 36490, checked in by kon, 7 weeks ago

fix type-errors-numbers import self (per #1506)

File size: 1.9 KB
Line 
1;;;; type-errors-numbers.impl.scm  -*- Scheme -*-
2;;;; Kon Lovett, Jul '18
3
4(import scheme
5  (only (chicken string) conc)
6  type-errors-basic)
7
8;;;
9
10(define-error-type fixnum)
11(define-error-type positive-fixnum)
12(define-error-type natural-fixnum)
13(define-error-type negative-fixnum)
14(define-error-type non-positive-fixnum)
15(define-error-type flonum)
16(define-error-type number)
17(define-error-type positive-number)
18(define-error-type natural-number)
19(define-error-type negative-number)
20(define-error-type non-positive-number)
21(define-error-type integer)
22(define-error-type positive-integer)
23(define-error-type natural-integer)
24(define-error-type negative-integer)
25(define-error-type non-positive-integer)
26(define-error-type real)
27(define-error-type complex)
28(define-error-type rational)
29(define-error-type exact)
30(define-error-type inexact)
31
32(define (error-range loc start end #!optional argnam)
33  (signal-bounds-error
34    loc
35    (make-bad-argument-message argnam)
36    start end) )
37
38(define (error-interval loc num lft min max rgt #!optional argnam)
39  (signal-bounds-error
40    loc
41    (conc (make-bad-argument-message argnam) " must be in " lft min " " max rgt)
42    num) )
43
44(define +left-open-interval+ '|(|)     ;'|]|
45(define +right-open-interval+ '|)|)    ;'|[|
46
47(define +left-closed-interval+ '|[|)
48(define +right-closed-interval+ '|]|)
49
50(define (error-closed-interval loc num min max #!optional argnam)
51  (error-interval loc num +left-closed-interval+ min max +right-closed-interval+ argnam))
52
53(define (error-open-interval loc num min max #!optional argnam)
54  (error-interval loc num +left-open-interval+ min max +right-open-interval+ argnam))
55
56(define (error-half-open-interval loc num min max #!optional argnam)
57  (error-interval loc num +left-open-interval+ min max +right-closed-interval+ argnam))
58
59(define (error-half-closed-interval loc num min max #!optional argnam)
60  (error-interval loc num +left-closed-interval+ min max +right-open-interval+ argnam))
Note: See TracBrowser for help on using the repository browser.