;;;; standard-conditions.memo.scm -*- Scheme -*- ;;;; Kon Lovett, Jan '23 (module (standard-conditions memo) (;export get) (import scheme (chicken base) condition-utils) ;;; Builtin Conditions (define (get sym) (case sym ; Signaled when a procedure is called with the wrong number of arguments. ((arity-condition?) (make-condition-predicate exn arity)) ; Signaled on type-mismatch errors, for example when an argument of the wrong ; type is passed to a built-in procedure. ((type-condition?) (make-condition-predicate exn type)) ; Signaled on arithmetic errors, like division by zero. ((arithmetic-condition?) (make-condition-predicate exn arithmetic)) ; Signaled on input/output errors. ((i/o-condition?) (make-condition-predicate exn i/o)) ; Signaled on file-related errors. ((file-condition?) (make-condition-predicate exn i/o file)) ; Signaled on network errors. ((network-condition?) (make-condition-predicate exn i/o net)) ; Signaled on network timeout errors. ((network-timeout-condition?) (make-condition-predicate exn i/o net timeout)) ; Signaled on errors caused by accessing non-existent elements of a collection. ((bounds-condition?) (make-condition-predicate exn bounds)) ; Signaled on low-level runtime-system error-situations. ((runtime-condition?) (make-condition-predicate exn runtime)) ; Signaled when an internal limit is exceeded (like running out of memory). ((runtime-limit-condition?) (make-condition-predicate exn runtime limit)) ; Signaled when a graph cycle detected. ((runtime-cycle-condition?) (make-condition-predicate exn runtime cycle)) ; Signaled on errors raised by failed matches (see the section on match). ((match-condition?) (make-condition-predicate exn match)) ; Signaled on syntax errors. ((syntax-condition?) (make-condition-predicate exn syntax)) ; Signaled on process errors. ((process-condition?) (make-condition-predicate exn process)) ; Signaled on access errors. ((access-condition?) (make-condition-predicate exn access)) ; Signaled on domain errors. ((domain-condition?) (make-condition-predicate exn domain)) ; Signaled on memory errors. ((memory-condition?) (make-condition-predicate exn memory)) ; (else (error 'get "undefined standard-conditions item" sym)) ) ) ) ;(standard-conditions memo)