Changeset 38935 in project


Ignore:
Timestamp:
08/30/20 17:01:24 (4 weeks ago)
Author:
Kon Lovett
Message:

add types, add -strict-types

Location:
release/5/check-errors/trunk
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • release/5/check-errors/trunk/check-errors.egg

    r38425 r38935  
    33
    44((synopsis "Argument checks & errors")
    5  (version "3.1.3")
     5 (version "3.2.0")
    66 (category misc)
    77 (license "BSD")
     
    1212  (extension type-errors-basic
    1313    (types-file)
    14     (csc-options "-O3" "-d1" "-no-procedure-checks" "-no-bound-checks") )
     14    (csc-options "-O3" "-d1" "-strict-types" "-no-procedure-checks" "-no-bound-checks") )
    1515  (extension type-errors-numbers
    1616    (types-file)
    17     (csc-options "-O3" "-d1" "-no-procedure-checks" "-no-bound-checks") )
     17    (csc-options "-O3" "-d1" "-strict-types" "-no-procedure-checks" "-no-bound-checks") )
    1818  (extension type-errors-atoms
    1919    (types-file)
    2020    (component-dependencies type-errors-numbers)
    21     (csc-options "-no-procedure-checks" "-no-bound-checks") )
     21    (csc-options"-O3" "-d1" "-strict-types" "-no-procedure-checks" "-no-bound-checks") )
    2222  (extension type-errors-structured
    2323    (types-file)
    24     (csc-options "-O3" "-d1" "-no-procedure-checks" "-no-bound-checks") )
     24    (csc-options "-O3" "-d1" "-strict-types" "-no-procedure-checks" "-no-bound-checks") )
    2525  (extension type-errors
    2626    (types-file)
    2727    (component-dependencies type-errors-basic type-errors-atoms type-errors-structured)
    28     (csc-options "-O3" "-d1" "-no-procedure-checks" "-no-bound-checks") )
     28    (csc-options "-O3" "-d1" "-strict-types" "-no-procedure-checks" "-no-bound-checks") )
    2929  ;;
    3030  (extension type-checks-basic
    3131    (types-file)
    3232    (component-dependencies type-errors-basic)
    33     (csc-options "-O3" "-d1" "-no-procedure-checks" "-no-bound-checks") )
     33    (csc-options "-O3" "-d1" "-strict-types" "-no-procedure-checks" "-no-bound-checks") )
    3434  (extension type-checks-numbers
    3535    (types-file)
    3636    (component-dependencies type-errors-numbers)
    37     (csc-options "-O3" "-d1" "-no-procedure-checks" "-no-bound-checks") )
     37    (csc-options "-O3" "-d1" "-strict-types" "-no-procedure-checks" "-no-bound-checks") )
    3838  (extension type-checks-atoms
    3939    (types-file)
    4040    (component-dependencies type-errors-atoms type-checks-numbers)
    41     (csc-options "-O3" "-d1" "-no-procedure-checks" "-no-bound-checks") )
     41    (csc-options "-O3" "-d1" "-strict-types" "-no-procedure-checks" "-no-bound-checks") )
    4242  (extension type-checks-structured
    4343    (types-file)
    4444    (component-dependencies type-errors-structured)
    45     (csc-options "-O3" "-d1" "-no-procedure-checks" "-no-bound-checks") )
     45    (csc-options "-O3" "-d1" "-strict-types" "-no-procedure-checks" "-no-bound-checks") )
    4646  (extension type-checks
    4747    (types-file)
    4848    (component-dependencies type-errors type-checks-basic type-checks-atoms type-checks-structured)
    49     (csc-options "-O3" "-d1" "-no-procedure-checks" "-no-bound-checks") )
     49    (csc-options "-O3" "-d1" "-strict-types" "-no-procedure-checks" "-no-bound-checks") )
    5050  ;;
    5151  (extension srfi-4-errors
    5252    (types-file)
    5353    (component-dependencies type-errors-structured)
    54     (csc-options "-O3" "-d1" "-no-procedure-checks" "-no-bound-checks") )
     54    (csc-options "-O3" "-d1" "-strict-types" "-no-procedure-checks" "-no-bound-checks") )
    5555  (extension srfi-4-checks
    5656    (types-file)
    5757    (component-dependencies type-checks srfi-4-errors)
    58     (csc-options "-O3" "-d1" "-no-procedure-checks" "-no-bound-checks") )
     58    (csc-options "-O3" "-d1" "-strict-types" "-no-procedure-checks" "-no-bound-checks") )
    5959  ;;
    6060  (extension check-errors
  • release/5/check-errors/trunk/check-errors.scm

    r35789 r38935  
    66(module check-errors ()
    77
    8 (import scheme (chicken module) (chicken foreign))
     8(import scheme)
     9(import (chicken module))
     10(import (chicken foreign))
     11
    912(import type-checks type-errors srfi-4-checks srfi-4-errors)
    10 
    1113(reexport type-checks type-errors srfi-4-checks srfi-4-errors)
    1214
  • release/5/check-errors/trunk/srfi-4-checks.impl.scm

    r36557 r38935  
    11;;;; srfi-4-checks.impl.scm  -*- Scheme -*-
    22;;;; Kon Lovett, Jul '18
    3 
    4 (import scheme (srfi 4) type-checks-basic srfi-4-errors)
    53
    64(define-check-type s8vector)
  • release/5/check-errors/trunk/srfi-4-checks.scm

    r35789 r38935  
    1717  check-f64vector)
    1818
     19(import scheme)
    1920(import (chicken base))                 ; for `include'
     21(import (chicken type))
     22(import (srfi 4) type-checks-basic srfi-4-errors)
     23
     24(: check-s8vector (* * #!optional * -> s8vector))
     25(: check-u8vector (* * #!optional * -> u8vector))
     26(: check-s16vector (* * #!optional * -> s16vector))
     27(: check-u16vector (* * #!optional * -> u16vector))
     28(: check-s32vector (* * #!optional * -> s32vector))
     29(: check-u32vector (* * #!optional * -> u32vector))
     30(: check-s64vector (* * #!optional * -> s64vector))
     31(: check-u64vector (* * #!optional * -> u64vector))
     32(: check-f32vector (* * #!optional * -> f32vector))
     33(: check-f64vector (* * #!optional * -> f64vector))
    2034
    2135(include "srfi-4-checks.impl.scm")
  • release/5/check-errors/trunk/srfi-4-errors.impl.scm

    r36557 r38935  
    11;;;; srfi-4-errors.impl.scm  -*- Scheme -*-
    22;;;; Kon Lovett, Jul '18
    3 
    4 (import scheme (srfi 4) type-errors-basic)
    53
    64(define-error-type s8vector)
  • release/5/check-errors/trunk/srfi-4-errors.scm

    r35789 r38935  
    1717  error-f64vector)
    1818
     19(import scheme)
    1920(import (chicken base))                 ; for `include'
     21(import (chicken type))
     22(import (srfi 4) type-errors-basic)
     23
     24(: error-s8vector (* * #!optional * -> noreturn))
     25(: error-u8vector (* * #!optional * -> noreturn))
     26(: error-s16vector (* * #!optional * -> noreturn))
     27(: error-u16vector (* * #!optional * -> noreturn))
     28(: error-s32vector (* * #!optional * -> noreturn))
     29(: error-u32vector (* * #!optional * -> noreturn))
     30(: error-s64vector (* * #!optional * -> noreturn))
     31(: error-u64vector (* * #!optional * -> noreturn))
     32(: error-f32vector (* * #!optional * -> noreturn))
     33(: error-f64vector (* * #!optional * -> noreturn))
     34
     35(define-error-type s8vector)
     36(define-error-type u8vector)
     37(define-error-type s16vector)
     38(define-error-type u16vector)
     39(define-error-type s32vector)
     40(define-error-type u32vector)
     41(define-error-type s64vector)
     42(define-error-type u64vector)
     43(define-error-type f32vector)
     44(define-error-type f64vector)
    2045
    2146(include "srfi-4-errors.impl.scm")
  • release/5/check-errors/trunk/type-checks-atoms.impl.scm

    r36557 r38935  
    11;;;; type-checks-atoms.impl.scm  -*- Scheme -*-
    22;;;; Kon Lovett, Jul '18
    3 
    4 (import scheme type-errors-atoms type-checks-basic)
    53
    64(define-check-type symbol)
  • release/5/check-errors/trunk/type-checks-atoms.scm

    r36557 r38935  
    1515  check-boolean)
    1616
     17(import scheme)
    1718(import (chicken base))                 ; for `include'
     19(import (chicken type))
     20(import (only (chicken keyword) keyword?))
     21(import type-errors-atoms type-checks-basic)
    1822
    19 (import (only (chicken keyword) keyword?))
     23(: check-symbol (* * #!optional * -> symbol))
     24(: check-keyword (* * #!optional * -> keyword))
     25(: check-char (* * #!optional * -> char))
     26(: check-boolean (* * #!optional * -> boolean))
    2027
    2128(include "type-checks-atoms.impl.scm")
  • release/5/check-errors/trunk/type-checks-basic.impl.scm

    r36557 r38935  
    9595
    9696(define (check-minimum-argument-count loc argc minargc)
    97   (unless (fx<= minargc argc)
     97  (unless (<= minargc argc)
    9898    (error-minimum-argument-count loc argc minargc))
    9999  argc )
    100100
    101101(define (check-argument-count loc argc maxargc)
    102   (unless (fx<= argc maxargc)
     102  (unless (<= argc maxargc)
    103103    (error-argument-count loc argc maxargc))
    104104  argc )
  • release/5/check-errors/trunk/type-checks-basic.scm

    r36557 r38935  
    1111  check-minimum-argument-count check-argument-count)
    1212
    13 (import (chicken base))                 ; for `include'
     13(import scheme)
     14(import (chicken base))
     15(import (chicken type))
     16(import (chicken syntax))
    1417
    15 (import (chicken syntax) (chicken fixnum))
     18(: check-defined-value (* 'a #!optional * -> 'a))
     19(: check-bound-value (* 'a #!optional * -> 'a))
     20(: check-minimum-argument-count (* fixnum fixnum -> fixnum))
     21(: check-argument-count (* fixnum fixnum -> fixnum))
    1622
    1723(include "type-checks-basic.impl.scm")
  • release/5/check-errors/trunk/type-checks-numbers.impl.scm

    r36557 r38935  
    77;;
    88;; - check-negative-* (< X 0), check-non-positive-* (<= X 0)
    9 
    10 (import scheme type-errors-numbers type-checks-basic)
    119
    1210;;
  • release/5/check-errors/trunk/type-checks-numbers.scm

    r36557 r38935  
    2121  check-range)
    2222
     23(import scheme)
    2324(import (chicken base))                 ; for `include'
     25(import (chicken type))
     26(import (chicken fixnum))
     27(import type-errors-numbers type-checks-basic)
    2428
    25 (import (chicken fixnum))
     29(: check-number (* * #!optional * -> number))
     30(: check-positive-number  (* * #!optional * -> number ))
     31(: check-natural-number  (* * #!optional * -> number ))
     32(: check-negative-number  (* * #!optional * -> number ))
     33(: check-non-positive-number (* * #!optional * -> number))
     34(: check-fixnum (* * #!optional * -> fixnum))
     35(: check-positive-fixnum (* * #!optional * -> fixnum))
     36(: check-natural-fixnum  (* * #!optional * -> fixnum ))
     37(: check-negative-fixnum  (* * #!optional * -> fixnum ))
     38(: check-non-positive-fixnum (* * #!optional * -> fixnum))
     39(: check-flonum (* * #!optional * -> float))
     40(: check-integer (* * #!optional * -> integer))
     41(: check-positive-integer (* * #!optional * -> integer))
     42(: check-natural-integer (* * #!optional * -> integer))
     43(: check-negative-integer (* * #!optional * -> integer))
     44(: check-non-positive-integer (* * #!optional * -> integer))
     45(: check-real (* * #!optional * -> number))
     46(: check-complex (* * #!optional * -> cplxnum))
     47(: check-rational (* * #!optional * -> ratnum))
     48(: check-exact (* * #!optional * -> number))
     49(: check-inexact (* * #!optional * -> number))
     50(: check-closed-interval  (* number number number #!optional * -> number))
     51(: check-open-interval (* number number number #!optional * -> number))
     52(: check-half-closed-interval  (* number number number #!optional * -> number))
     53(: check-half-open-interval (* number number number #!optional * -> number))
     54(: check-range (* number number #!optional * -> number number))
    2655
    2756(include "type-checks-numbers.impl.scm")
  • release/5/check-errors/trunk/type-checks-structured.impl.scm

    r36557 r38935  
    11;;;; type-checks-structured.impl.scm  -*- Scheme -*-
    22;;;; Kon Lovett, Jul '18
    3 
    4 (import scheme type-errors-structured type-checks-basic)
    53
    64;;
  • release/5/check-errors/trunk/type-checks-structured.scm

    r36557 r38935  
    2121  check-string)
    2222
     23(import scheme)
    2324(import (chicken base))                 ; for `include'
     25(import (chicken type))
     26(import (only (chicken blob) blob?))
     27(import type-errors-structured type-checks-basic)
    2428
    25 (import (only (chicken blob) blob?))
     29(: check-structure (* 'a * #!optional * -> 'a))
     30(: check-record (* 'a * #!optional * -> 'a))
     31(: check-record-type (* 'a * #!optional * -> 'a))
     32(: check-string (* * #!optional * -> string))
     33(: check-procedure (* * #!optional * -> procedure))
     34(: check-closure (* * #!optional * -> procedure))
     35(: check-input-port (* * #!optional * -> input-port))
     36(: check-output-port (* * #!optional * -> output-port))
     37(: check-list (* * #!optional * -> list))
     38(: check-plist (* 'a #!optional * -> 'a))
     39(: check-alist (* 'a #!optional * -> 'a))
     40(: check-pair (* * #!optional * -> pair))
     41(: check-blob (* * #!optional * -> blob))
     42(: check-vector (* * #!optional * -> vector))
    2643
    2744(include "type-checks-structured.impl.scm")
  • release/5/check-errors/trunk/type-checks.scm

    r35789 r38935  
    66(module type-checks ()
    77
    8 (import scheme (chicken module))
     8(import scheme)
     9(import (chicken module))
     10
    911(import type-checks-basic type-checks-atoms type-checks-structured)
    10 
    1112(reexport type-checks-basic type-checks-atoms type-checks-structured)
    1213
  • release/5/check-errors/trunk/type-errors-atoms.impl.scm

    r36557 r38935  
    1212;; "... not a list" -> "... list required".
    1313
    14 (import scheme type-errors-basic)
    15 
    1614;;;
    1715
  • release/5/check-errors/trunk/type-errors-atoms.scm

    r35789 r38935  
    22;;;; Kon Lovett, Jul '18
    33
    4 (module type-errors-atoms ()
     4(module type-errors-atoms
    55
    6 (import (chicken module))                       ; for `export' & `reexport'
    7 
    8 (import type-errors-numbers)
    9 (reexport type-errors-numbers)
    10 
    11 (export
     6(;export
    127  error-symbol
    138  error-keyword
     
    1510  error-boolean)
    1611
    17 (import (chicken base))                 ; for `include'
     12(import scheme)
     13(import (chicken base))
     14(import (chicken module))
     15(import (chicken type))
     16(import type-errors-basic)
     17
     18(import type-errors-numbers)
     19(reexport type-errors-numbers)
     20
     21(: error-symbol (* * #!optional * -> noreturn))
     22(: error-keyword (* * #!optional * -> noreturn))
     23(: error-char (* * #!optional * -> noreturn))
     24(: error-boolean (* * #!optional * -> noreturn))
    1825
    1926(include "type-errors-atoms.impl.scm")
  • release/5/check-errors/trunk/type-errors-basic.impl.scm

    r38253 r38935  
    1111;;
    1212;; Or "... not integer", ...
    13 
    14 (import scheme)
    1513
    1614;;;
  • release/5/check-errors/trunk/type-errors-basic.scm

    r36557 r38935  
    66    ##sys#signal-hook ##sys#error-hook) )
    77
    8 (module type-errors-basic ()
     8(module type-errors-basic
    99
    10 (import (chicken module))
    11 
    12 (export
     10(;export
    1311  ;
    1412  (define-error-type error-argument-type)
     
    2927  error-argument-count)
    3028
    31 (import (chicken base))                 ; for `include'
     29(import scheme)
     30(import (chicken base))
     31(import (chicken type))
     32(import (only (chicken string) ->string conc))
     33(import (chicken foreign))
    3234
    33 (import
    34   (only (chicken string) ->string conc)
    35   (chicken foreign)
    36   (chicken type))
     35(: make-bad-argument-message (#!optional * -> string))
     36(: make-type-name-message (* -> string))
     37(: make-error-type-message (string #!optional * -> string))
     38(: signal-bounds-error (* #!rest -> noreturn))
     39(: signal-type-error (* #!rest -> noreturn))
     40(: error-argument-type (* * * #!optional * -> noreturn))
     41(: warning-argument-type (* * * #!optional * -> noreturn))
     42(: error-bound-value (* * #!optional * -> noreturn))
     43(: error-defined-value (* * #!optional * -> noreturn))
     44(: error-minimum-argument-count (* fixnum fixnum -> noreturn))
     45(: error-argument-count (* fixnum fixnum -> noreturn))
    3746
    3847(include "type-errors-basic.impl.scm")
  • release/5/check-errors/trunk/type-errors-numbers.impl.scm

    r36557 r38935  
    11;;;; type-errors-numbers.impl.scm  -*- Scheme -*-
    22;;;; Kon Lovett, Jul '18
    3 
    4 (import scheme type-errors-basic)
    53
    64;;
  • release/5/check-errors/trunk/type-errors-numbers.scm

    r36557 r38935  
    22;;;; Kon Lovett, Jul '18
    33
    4 (module type-errors-numbers ()
     4(module type-errors-numbers
    55
    6 (import (chicken module))
    7 
    8 (export
     6(;export
    97  ;
    108  error-range
     
    2826  error-inexact)
    2927
    30 (import (chicken base))                 ; for `include'
     28(import scheme)
     29(import (chicken base))
     30(import (chicken type))
     31(import (only (chicken string) conc))
     32(import type-errors-basic)
    3133
    32 (import (only (chicken string) conc))
     34(: error-range (* number number #!optional * -> noreturn))
     35(: error-interval (* * * number number * #!optional * -> noreturn))
     36(: error-closed-interval (* * number number #!optional * -> noreturn))
     37(: error-open-interval (* * number number #!optional * -> noreturn))
     38(: error-half-open-interval (* * number number #!optional * -> noreturn))
     39(: error-half-closed-interval (* * number number #!optional * -> noreturn))
     40(: error-fixnum (* * #!optional * -> noreturn))
     41(: error-positive-fixnum (* * #!optional * -> noreturn))
     42(: error-natural-fixnum (* * #!optional * -> noreturn))
     43(: error-negative-fixnum (* * #!optional * -> noreturn))
     44(: error-non-positive-fixnum (* * #!optional * -> noreturn))
     45(: error-flonum (* * #!optional * -> noreturn))
     46(: error-number (* * #!optional * -> noreturn))
     47(: error-positive-number (* * #!optional * -> noreturn))
     48(: error-natural-number (* * #!optional * -> noreturn))
     49(: error-negative-number (* * #!optional * -> noreturn))
     50(: error-non-positive-number (* * #!optional * -> noreturn))
     51(: error-integer (* * #!optional * -> noreturn))
     52(: error-positive-integer (* * #!optional * -> noreturn))
     53(: error-natural-integer (* * #!optional * -> noreturn))
     54(: error-negative-integer (* * #!optional * -> noreturn))
     55(: error-non-positive-integer (* * #!optional * -> noreturn))
     56(: error-real (* * #!optional * -> noreturn))
     57(: error-complex (* * #!optional * -> noreturn))
     58(: error-rational (* * #!optional * -> noreturn))
     59(: error-exact (* * #!optional * -> noreturn))
     60(: error-inexact (* * #!optional * -> noreturn))
    3361
    3462(include "type-errors-numbers.impl.scm")
  • release/5/check-errors/trunk/type-errors-structured.impl.scm

    r36557 r38935  
    11;;;; type-errors-structured.impl.scm  -*- Scheme -*-
    22;;;; Kon Lovett, Jul '18
    3 
    4 (import scheme type-errors-basic)
    53
    64;;
  • release/5/check-errors/trunk/type-errors-structured.scm

    r36557 r38935  
    2121  error-string)
    2222
     23(import scheme)
    2324(import (chicken base))                 ; for `include'
     25(import (chicken type))
     26(import (only (chicken string) conc))
     27(import type-errors-basic)
    2428
    25 (import (only (chicken string) conc))
     29(: error-procedure (* * #!optional * -> noreturn))
     30(: error-closure (* * #!optional * -> noreturn))
     31(: error-input-port (* * #!optional * -> noreturn))
     32(: error-output-port (* * #!optional * -> noreturn))
     33(: error-list (* * #!optional * -> noreturn))
     34(: error-plist (* * #!optional * -> noreturn))
     35(: error-alist (* * #!optional * -> noreturn))
     36(: error-pair (* * #!optional * -> noreturn))
     37(: error-blob (* * #!optional * -> noreturn))
     38(: error-vector (* * #!optional * -> noreturn))
     39(: error-string (* * #!optional * -> noreturn))
     40(: error-structure (* * * #!optional * -> noreturn))
     41(: error-record (* * * #!optional * -> noreturn))
     42(: error-record-type (* * * #!optional * -> noreturn))
    2643
    2744(include "type-errors-structured.impl.scm")
  • release/5/check-errors/trunk/type-errors.scm

    r35789 r38935  
    66(module type-errors ()
    77
    8 (import scheme (chicken module))
     8(import scheme)
     9(import (chicken module))
     10
    911(import type-errors-basic type-errors-atoms type-errors-structured)
    10 
    1112(reexport type-errors-basic type-errors-atoms type-errors-structured)
    1213
Note: See TracChangeset for help on using the changeset viewer.