;;;; condition-utils.inline.scm -*- Scheme -*- ;;;; Kon Lovett, Jan '25 #; ;NO, not a `predicate' type. that requires subtypes! (define-type condition-predicate (* -> boolean : condition)) (define-type condition-predicate (* -> boolean)) (define-type condition-property-accessor (condition -> *)) ;FIXME not call/cc-safe ;How does this work w/ -local? (define-syntax defon1st (syntax-rules () ((defon1st ?nam ?typ ?e0 ...) (begin (: ?nam ?typ) (define ?nam (let ((+proc+ (the (or false ?typ) #f))) (lambda (x) (unless +proc+ (let ((+proc+ (begin ?e0 ...))) (set! ?nam +proc+) (+proc+ x)) ) ) ) ) ) ) ) ) (define-syntax define-condition-predicate (syntax-rules () ((define-condition-predicate ?nam ?d0 ...) (defon1st ?nam condition-predicate (make-condition-predicate ?d0 ...)) ) ) ) (define-syntax define-condition-property-accessor (syntax-rules () ((define-condition-property-accessor ?nam ?d0 ...) (defon1st ?nam condition-property-accessor (make-condition-property-accessor ?d0 ...)) ) ) )