You are looking at historical revision 41413 of this page. It may differ significantly from its current revision.

check-errors

Argument checks & errors.

  1. check-errors
  2. Documentation
    1. Argument Conventions
    2. Type Checks
      1. Usage
      2. Type Checks Basic
        1. Usage
        2. check-defined-value
        3. check-bound-value
        4. check-minimum-argument-count
        5. check-argument-count
        6. define-check-type
        7. define-check+error-type
      3. Type Checks Numbers
        1. Usage
        2. check-number
        3. check-positive-number
        4. check-natural-number
        5. check-negative-number
        6. check-non-positive-number
        7. check-integer
        8. check-positive-integer
        9. check-natural-integer
        10. check-negative-integer
        11. check-non-positive-integer
        12. check-real
        13. check-complex
        14. check-rational
        15. check-exact
        16. check-inexact
        17. check-fixnum
        18. check-positive-fixnum
        19. check-natural-fixnum
        20. check-negative-fixnum
        21. check-non-positive-fixnum
        22. check-bignum
        23. check-positive-bignum
        24. check-negative-bignum
        25. check-non-positive-bignum
        26. check-ratnum
        27. check-positive-ratnum
        28. check-negative-ratnum
        29. check-non-positive-ratnum
        30. check-float
        31. check-flonum
        32. check-cplxnum
        33. check-open-interval
        34. check-closed-interval
        35. check-half-open-interval
        36. check-half-closed-interval
        37. check-range
      4. Type Checks Structured
        1. Usage
        2. check-procedure
        3. check-input-port
        4. check-output-port
        5. check-list
        6. check-alist
        7. check-plist
        8. check-pair
        9. check-blob
        10. check-vector
        11. check-structure
        12. check-string
      5. Type Checks Atoms
        1. Usage
        2. check-symbol
        3. check-keyword
        4. check-char
        5. check-boolean
    3. Type Errors
      1. Argument Conventions
      2. Usage
      3. Type Errors Basic
        1. Usage
        2. make-bad-argument-message
        3. make-type-name-message
        4. make-error-type-message
        5. make-location-message
        6. make-warning-type-message
        7. make-error-interval-message
        8. signal-bounds-error
        9. signal-type-error
        10. error-argument-type
        11. warning-argument-type
        12. error-defined-value
        13. error-bound-value
        14. error-minimum-argument-count
        15. error-argument-count
        16. define-error-type
      4. Type Errors Numbers
        1. Usage
        2. error-number
        3. error-positive-number
        4. error-natural-number
        5. error-negative-number
        6. error-non-positive-number
        7. error-integer
        8. error-positive-integer
        9. error-natural-integer
        10. error-negative-integer
        11. error-non-positive-integer
        12. error-real
        13. error-complex
        14. error-rational
        15. error-exact
        16. error-inexact
        17. error-fixnum
        18. error-positive-fixnum
        19. error-natural-fixnum
        20. error-negative-fixnum
        21. error-non-positive-fixnum
        22. error-bignum
        23. error-positive-bignum
        24. error-negative-bignum
        25. error-non-positive-bignum
        26. error-ratnum
        27. error-positive-ratnum
        28. error-negative-ratnum
        29. error-non-positive-ratnum
        30. error-float
        31. error-flonum
        32. error-cplxnum
        33. error-open-interval
        34. error-closed-interval
        35. error-half-open-interval
        36. error-half-closed-interval
        37. error-range
        38. error-interval
      5. Type Errors Structured
        1. Usage
        2. error-procedure
        3. error-input-port
        4. error-output-port
        5. error-list
        6. error-alist
        7. error-plist
        8. error-pair
        9. error-blob
        10. error-vector
        11. error-structure
        12. error-string
      6. Type Errors Atoms
        1. Usage
        2. error-symbol
        3. error-keyword
        4. error-char
        5. error-boolean
    4. SRFI 4 Checks
      1. Usage
      2. check-s8vector
      3. check-u8vector
      4. check-s16vector
      5. check-u16vector
      6. check-s32vector
      7. check-u32vector
      8. check-s64vector
      9. check-u64vector
      10. check-f32vector
      11. check-f64vector
    5. SRFI 4 Errors
      1. Usage
      2. error-s8vector
      3. error-u8vector
      4. error-s16vector
      5. error-u16vector
      6. error-s32vector
      7. error-u32vector
      8. error-s64vector
      9. error-u64vector
      10. error-f32vector
      11. error-f64vector
  3. Notes
  4. Bugs & Limitations
  5. Author
  6. Repository
  7. Version history
  8. License

Documentation

Argument Conventions

LOC is a symbol, or #f. The symbolic naming of the location detecting the problem. As in the error form.

OBJ is any Scheme object.

ARGNAM is a string or symbol naming the argument list element corresponding to the OBJ. The default is the type-name.

Type Checks

Performs the minimal constraint check and raises an error condition upon failure. The mimimal constraint proviso is important for understanding the behavior of the checking routines. Unless otherwise specified no additional constraints are verified.

So the check-...-interval routines, for example, do not verify the types of the arguments, only the interval constraint.

When the unsafe feature is defined the check procedures are no-ops.

All check-... routines return the checked object.

Usage

(import type-checks)

Type Checks Basic

Usage
(import type-checks-basic)
check-defined-value
[procedure] (check-defined-value LOC OBJ [ARGNAM]) -> *

Ensures the OBJ is non-void, i.e. not an undefined-value.

check-bound-value
[procedure] (check-bound-value LOC OBJ [ARGNAM]) -> *

Ensures the OBJ is the value of a bound variable.

Only for use in rather unsafe calling environments where some explicit checking is necessary.

check-minimum-argument-count
[procedure] (check-minimum-argument-count LOC ARGC MINARGC) -> fixnum

Does not verify the type of ARGC, and MINARGC.

check-argument-count
[procedure] (check-argument-count LOC ARGC MAXARGC) -> fixnum

Does not verify the type of ARGC, and MAXARGC.

define-check-type
[syntax] (define-check-type TYPNAM [TYPE-PRED])

Creates a procedure definition for check-TYPNAM with the signature of the above check procedures. The type-predicate is either TYPE-PRED, when present, or TYPNAM?.

TYPNAM is an unquoted symbol.

(define-check-type hash-table)
;=>
;(define (check-hash-table loc obj #!optional argnam)
;  (unless (hash-table? obj)
;    (error-hash-table loc obj argnam))
;  obj )
define-check+error-type
[syntax] (define-check+error-type TYPNAM [TYPE-PRED [TYPMSG]])

Creates a procedure definition for check-TYPNAM with the signature of the above check procedures. The type-predicate is either TYPE-PRED, when present, or TYPE?. The error message type-name is either the TYPMSG, when present, or "TYPNAM"".

TYPNAM is an unquoted symbol.

(define-check+error-type hash-table)
;=>
;(begin
;  (define-error-type hash-table)
;  (define (check-hash-table loc obj #!optional argnam)
;    (unless (hash-table? obj)
;      (error-hash-table loc obj argnam))
;    obj))

Type Checks Numbers

Usage
(import type-checks-numbers)
check-number
check-positive-number
check-natural-number
check-negative-number
check-non-positive-number
[procedure] (check-number LOC OBJ [ARGNAM]) -> number
[procedure] (check-positive-number LOC OBJ [ARGNAM]) -> number
[procedure] (check-natural-number LOC OBJ [ARGNAM]) -> number
[procedure] (check-negative-number LOC OBJ [ARGNAM]) -> number
[procedure] (check-non-positive-number LOC OBJ [ARGNAM]) -> number
check-integer
check-positive-integer
check-natural-integer
check-negative-integer
check-non-positive-integer
[procedure] (check-integer LOC OBJ [ARGNAM]) -> integer
[procedure] (check-positive-integer LOC OBJ [ARGNAM]) -> integer
[procedure] (check-natural-integer LOC OBJ [ARGNAM]) -> integer
[procedure] (check-negative-integer LOC OBJ [ARGNAM]) -> integer
[procedure] (check-non-positive-integer LOC OBJ [ARGNAM]) -> integer
check-real
check-complex
check-rational
check-exact
check-inexact
[procedure] (check-real LOC OBJ [ARGNAM]) -> number
[procedure] (check-complex LOC OBJ [ARGNAM]) -> number
[procedure] (check-rational LOC OBJ [ARGNAM]) -> number
[procedure] (check-exact LOC OBJ [ARGNAM]) -> number
[procedure] (check-inexact LOC OBJ [ARGNAM]) -> number
check-fixnum
check-positive-fixnum
check-natural-fixnum
check-negative-fixnum
check-non-positive-fixnum
[procedure] (check-fixnum LOC OBJ [ARGNAM]) -> fixnum
[procedure] (check-positive-fixnum LOC OBJ [ARGNAM]) -> fixnum
[procedure] (check-natural-fixnum LOC OBJ [ARGNAM]) -> fixnum
[procedure] (check-negative-fixnum LOC OBJ [ARGNAM]) -> fixnum
[procedure] (check-non-positive-fixnum LOC OBJ [ARGNAM]) -> fixnum
check-bignum
check-positive-bignum
check-negative-bignum
check-non-positive-bignum
[procedure] (check-bignum LOC OBJ [ARGNAM]) -> bignum
[procedure] (check-natural-bignum LOC OBJ [ARGNAM]) -> bignum
[procedure] (check-negative-bignum LOC OBJ [ARGNAM]) -> bignum
[procedure] (check-non-positive-bignum LOC OBJ [ARGNAM]) -> integer
check-ratnum
check-positive-ratnum
check-negative-ratnum
check-non-positive-ratnum
[procedure] (check-ratnum LOC OBJ [ARGNAM]) -> ratnum
[procedure] (check-positive-ratnum LOC OBJ [ARGNAM]) -> ratnum
[procedure] (check-negative-ratnum LOC OBJ [ARGNAM]) -> ratnum
[procedure] (check-non-positive-ratnum LOC OBJ [ARGNAM]) -> ratnum
check-float
check-flonum
[procedure] (check-float LOC OBJ [ARGNAM]) -> flonum
[procedure] (check-flonum LOC OBJ [ARGNAM]) -> flonum
check-cplxnum
[procedure] (check-cplxnum LOC OBJ [ARGNAM]) -> cplxnum
check-open-interval
[procedure] (check-open-interval LOC NUM MINNUM MAXNUM [ARGNAM]) -> number

NUM in ]MINNUM MAXNUM[.

Does not verify the type of NUM, MINNUM, and MAXNUM.

check-closed-interval
[procedure] (check-closed-interval LOC NUM MINNUM MAXNUM [ARGNAM]) -> number

NUM in [MINNUM MAXNUM].

Does not verify the type of NUM, MINNUM, and MAXNUM.

check-half-open-interval
[procedure] (check-half-open-interval LOC NUM MINNUM MAXNUM [ARGNAM]) -> number

NUM in ]MINNUM MAXNUM].

Does not verify the type of NUM, MINNUM, and MAXNUM.

check-half-closed-interval
[procedure] (check-half-closed-interval LOC NUM MINNUM MAXNUM [ARGNAM]) -> number

NUM in [MINNUM MAXNUM[.

Does not verify the type of NUM, MINNUM, and MAXNUM.

check-range
[procedure] (check-range LOC START END [ARGNAM]) -> number number

Verify (<= START END) & return (values START END).

Does not verify the type of START and END, but assumes (or fixnum flonum).

Type Checks Structured

Usage
(import type-checks-structured)
check-procedure
[procedure] (check-procedure LOC OBJ [ARGNAM]) -> procedure
check-input-port
[procedure] (check-input-port LOC OBJ [ARGNAM]) -> input-port
check-output-port
[procedure] (check-output-port LOC OBJ [ARGNAM]) -> output-port
check-list
[procedure] (check-list LOC OBJ [ARGNAM]) -> list
check-alist
[procedure] (check-alist LOC OBJ [ARGNAM]) -> alist
check-plist
[procedure] (check-plist LOC OBJ [ARGNAM]) -> plist
check-pair
[procedure] (check-pair LOC OBJ [ARGNAM]) -> pair
check-blob
[procedure] (check-blob LOC OBJ [ARGNAM]) -> blob
check-vector
[procedure] (check-vector LOC OBJ [ARGNAM]) -> vector
check-structure
[procedure] (check-structure LOC OBJ TAG [ARGNAM]) -> structure
[procedure] (check-record LOC OBJ TAG [ARGNAM]) -> structure
[procedure] (check-record-type LOC OBJ TAG [ARGNAM]) -> structure

check-record and check-record-type are essentially synonyms.

check-string
[procedure] (check-string LOC OBJ [ARGNAM]) -> string

Type Checks Atoms

Usage
(import type-checks-atoms)
check-symbol
[procedure] (check-symbol LOC OBJ [ARGNAM]) -> symbol
check-keyword
[procedure] (check-keyword LOC OBJ [ARGNAM]) -> keyword
check-char
[procedure] (check-char LOC OBJ [ARGNAM]) -> char
check-boolean
[procedure] (check-boolean LOC OBJ [ARGNAM]) -> boolean

Type Errors

Argument Conventions

TYPNAM is a symbol or string, unless otherwise indicated.

ARGNAM is a symbol, string, or #f. Default is #f.

Usage

(import type-errors)

Type Errors Basic

Usage
(import type-errors-basic)
make-bad-argument-message
[procedure] (make-bad-argument-message [ARGNAM]) --> string

Returns an argument type error message for the, optional, ARGNAM.

Example:

(make-bad-argument-message "count")
;=> "bad `count' argument"
(make-bad-argument-message)
;=> "bad argument"
make-type-name-message
[procedure] (make-type-name-message TYPNAM) --> string

Returns an argument type message for the TYPNAM by supplying an article.

Example:

(make-type-name-message integer) ;=> an integer"
(make-type-name-message "symbol in {foo bar baz}")
;=> "a symbol in {foo bar baz}"
make-error-type-message
[procedure] (make-error-type-message TYPNAM [ARGNAM]) --> string

Returns a type error message from the TYPNAM and optional ARGNAM.

Uses make-bad-argument-message and make-type-name-message to build the message components.

Example:

(make-error-type-message 'integer "count")
;=> "bad `count' argument type - not an integer"
make-location-message
[procedure] (make-location-message LOC) --> string
make-warning-type-message
[procedure] (make-warning-type-message LOC OBJ TYPNAM [ARGNAM]) --> string
make-error-interval-message
[procedure] (make-error-interval-message LFT MIN MAX RGT [ARGNAM]) --> string
signal-bounds-error
[procedure] (signal-bounds-error LOC MSG OBJ...)

Raises a non-continuable type error - (({exn bounds)}}.

signal-type-error
[procedure] (signal-type-error LOC MSG OBJ...)

Raises a non-continuable type error - (({exn type)}}.

error-argument-type
[procedure] (error-argument-type LOC OBJ TYPNAM [ARGNAM])

Raises a type-error where is message is constructed from the TYPNAM and ARGNAM.

Uses signal-type-error and make-error-type-message.

warning-argument-type
[procedure] (warning-argument-type LOC OBJ TYPNAM [ARGNAM])

A warning is issued with a message similar to that of error-argument-type.

error-defined-value
[procedure] (error-defined-value LOC OBJ [ARGNAM])
error-bound-value
[procedure] (error-bound-value LOC OBJ [ARGNAM])
error-minimum-argument-count
[procedure] (error-minimum-argument-count LOC ARGC MINARGC)
error-argument-count
[procedure] (error-argument-count LOC ARGC MAXARGC)
define-error-type
[syntax] (define-error-type TYPNAM [TYPMSG])

TYPNAM is a symbol.

TYPMSG is a symbol or string.

Creates a procedure definition for error-TYPNAM with the signature of the above error procedures. The type-name is either TYPMSG, when present, or "TYPNAM".

(define-error-type hash-table)
;=>
;(define (error-hash-table loc obj #!optional argnam)
;  (error-argument-type loc obj "hash-table" argnam) )

(define-error-type byte-order "symbol in {big-endian little-endian}")
;=>
;(define (error-byte-order loc obj #!optional argnam)
;  (error-argument-type loc obj "symbol in {big-endian little-endian}" argnam) )

Type Errors Numbers

Usage
(import type-errors-numbers)
error-number
error-positive-number
error-natural-number
error-negative-number
error-non-positive-number
[procedure] (error-number LOC OBJ [ARGNAM])
[procedure] (error-positive-number LOC OBJ [ARGNAM])
[procedure] (error-natural-number LOC OBJ [ARGNAM])
[procedure] (error-negative-number LOC OBJ [ARGNAM])
[procedure] (error-non-positive-number LOC OBJ [ARGNAM])
error-integer
error-positive-integer
error-natural-integer
error-negative-integer
error-non-positive-integer
[procedure] (error-integer LOC OBJ [ARGNAM])
[procedure] (error-positive-integer LOC OBJ [ARGNAM])
[procedure] (error-natural-integer LOC OBJ [ARGNAM])
[procedure] (error-negative-integer LOC OBJ [ARGNAM])
[procedure] (error-non-positive-integer LOC OBJ [ARGNAM])
error-real
error-complex
error-rational
error-exact
error-inexact
[procedure] (error-real LOC OBJ [ARGNAM])
[procedure] (error-complex LOC OBJ [ARGNAM])
[procedure] (error-rational LOC OBJ [ARGNAM])
[procedure] (error-exact LOC OBJ [ARGNAM])
[procedure] (error-inexact LOC OBJ [ARGNAM])
error-fixnum
error-positive-fixnum
error-natural-fixnum
error-negative-fixnum
error-non-positive-fixnum
[procedure] (error-fixnum LOC OBJ [ARGNAM])
[procedure] (error-positive-fixnum LOC OBJ [ARGNAM])
[procedure] (error-natural-fixnum LOC OBJ [ARGNAM])
[procedure] (error-negative-fixnum LOC OBJ [ARGNAM])
[procedure] (error-non-positive-fixnum LOC OBJ [ARGNAM])
error-bignum
error-positive-bignum
error-negative-bignum
error-non-positive-bignum
[procedure] (error-bignum LOC OBJ [ARGNAM])
[procedure] (error-natural-bignum LOC OBJ [ARGNAM])
[procedure] (error-negative-bignum LOC OBJ [ARGNAM])
[procedure] (error-non-positive-bignum LOC OBJ [ARGNAM])
error-ratnum
error-positive-ratnum
error-negative-ratnum
error-non-positive-ratnum
[procedure] (error-ratnum LOC OBJ [ARGNAM])
[procedure] (error-positive-ratnum LOC OBJ [ARGNAM])
[procedure] (error-negative-ratnum LOC OBJ [ARGNAM])
[procedure] (error-non-positive-ratnum LOC OBJ [ARGNAM])
error-float
error-flonum
[procedure] (error-flonum LOC OBJ [ARGNAM])
[procedure] (error-float LOC OBJ [ARGNAM])
error-cplxnum
[procedure] (error-cplxnum LOC OBJ [ARGNAM])
error-open-interval
[procedure] (error-open-interval LOC NUM MINNUM MAXNUM [ARGNAM])
error-closed-interval
[procedure] (error-closed-interval LOC NUM MINNUM MAXNUM [ARGNAM])
error-half-open-interval
[procedure] (error-half-open-interval LOC NUM MINNUM MAXNUM [ARGNAM])
error-half-closed-interval
[procedure] (error-half-closed-interval LOC NUM MINNUM MAXNUM [ARGNAM])
error-range
[procedure] (error-range LOC START END [ARGNAM])
error-interval
[procedure] (error-interval LOC NUM LEFT MINNUM MAXNUM RIGHT [ARGNAM])

LEFT is a character, symbol, or string that denotes the symbolic opening of an interval.

RIGHT is a character, symbol, or string that denotes the symbolic closing of an interval.

Type Errors Structured

Usage
(import type-errors-structured)
error-procedure
[procedure] (error-procedure LOC OBJ [ARGNAM])
error-input-port
[procedure] (error-input-port LOC OBJ [ARGNAM])
error-output-port
[procedure] (error-output-port LOC OBJ [ARGNAM])
error-list
[procedure] (error-list LOC OBJ [ARGNAM])
error-alist
[procedure] (error-alist LOC OBJ [ARGNAM])
error-plist
[procedure] (error-plist LOC OBJ [ARGNAM])
error-pair
[procedure] (error-pair LOC OBJ [ARGNAM])
error-blob
[procedure] (error-blob LOC OBJ [ARGNAM])
error-vector
[procedure] (error-vector LOC OBJ [ARGNAM])
error-structure
[procedure] (error-structure LOC OBJ TAG [ARGNAM])

error-record and error-record-type are essentially synonyms.

error-string
[procedure] (error-string LOC OBJ [ARGNAM])

Type Errors Atoms

Usage
(import type-errors-atoms)
error-symbol
[procedure] (error-symbol LOC OBJ [ARGNAM])
error-keyword
[procedure] (error-keyword LOC OBJ [ARGNAM])
error-char
[procedure] (error-char LOC OBJ [ARGNAM])
error-boolean
[procedure] (error-boolean LOC OBJ [ARGNAM])

SRFI 4 Checks

Usage

(import srfi-4-checks)

check-s8vector

check-u8vector

check-s16vector

check-u16vector

check-s32vector

check-u32vector

check-s64vector

check-u64vector

check-f32vector

check-f64vector

[procedure] (check-s8vector LOC OBJ [ARGNAM]) -> *
[procedure] (check-u8vector LOC OBJ [ARGNAM]) -> *
[procedure] (check-s16vector LOC OBJ [ARGNAM]) -> *
[procedure] (check-u16vector LOC OBJ [ARGNAM]) -> *
[procedure] (check-s32vector LOC OBJ [ARGNAM]) -> *
[procedure] (check-u32vector LOC OBJ [ARGNAM]) -> *
[procedure] (check-s64vector LOC OBJ [ARGNAM]) -> *
[procedure] (check-u64vector LOC OBJ [ARGNAM]) -> *
[procedure] (check-f32vector LOC OBJ [ARGNAM]) -> *
[procedure] (check-f64vector LOC OBJ [ARGNAM]) -> *

SRFI 4 Errors

Usage

(import srfi-4-errors)

error-s8vector

error-u8vector

error-s16vector

error-u16vector

error-s32vector

error-u32vector

error-s64vector

error-u64vector

error-f32vector

error-f64vector

[procedure] (error-s8vector LOC OBJ [ARGNAM])
[procedure] (error-u8vector LOC OBJ [ARGNAM])
[procedure] (error-s16vector LOC OBJ [ARGNAM])
[procedure] (error-u16vector LOC OBJ [ARGNAM])
[procedure] (error-s32vector LOC OBJ [ARGNAM])
[procedure] (error-u32vector LOC OBJ [ARGNAM])
[procedure] (error-s64vector LOC OBJ [ARGNAM])
[procedure] (error-u64vector LOC OBJ [ARGNAM])
[procedure] (error-f32vector LOC OBJ [ARGNAM])
[procedure] (error-f64vector LOC OBJ [ARGNAM])

Notes

Example:

(check-symbol 'v-op oper 'oper)
(check-integer 'v-op x "x coordinate")
(check-integer 'v-op y "y coordinate")

Bugs & Limitations

Author

Kon Lovett

Repository

This egg is hosted on the CHICKEN Subversion repository:

https://anonymous@code.call-cc.org/svn/chicken-eggs/release/5/check-errors

If you want to check out the source code repository of this egg and you are not familiar with Subversion, see this page.

Version history

3.3.0 ; Add bignum/ratnum/cplxnum/float. Fix complex/rational.
3.2.6 ; .
3.2.5 ; Test improvements.
3.2.4 ; Add make-error-interval-message, make-warning-type-message, & make-location-message. The make-*-message API is pure. Fix check-* routines unbound checking.
3.2.3 ; .
3.2.2 ; .
3.2.1 ; .
3.2.0 ; .
3.1.2 ; .
3.1.1 ; .
3.1.0 ; Add type-errors/checks-basic/numbers/atoms/structured modules.
3.0.0 ; CHICKEN 5 release.

License

Copyright (C) 2009-2022 Kon Lovett. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ASIS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.