mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-24 04:25:06 +02:00
Issue #225 - Added error-object interfaces
This is only a rough-cut of the actual implementation, though.
This commit is contained in:
parent
061a6fd83a
commit
c339234632
1 changed files with 9 additions and 3 deletions
|
@ -113,9 +113,9 @@
|
||||||
current-input-port
|
current-input-port
|
||||||
current-error-port
|
current-error-port
|
||||||
call-with-port
|
call-with-port
|
||||||
; TODO: error-object?
|
error-object?
|
||||||
; TODO: error-object-message
|
error-object-message
|
||||||
; TODO: error-object-irritants
|
error-object-irritants
|
||||||
; TODO: file-error?
|
; TODO: file-error?
|
||||||
; TODO: read-error?
|
; TODO: read-error?
|
||||||
error
|
error
|
||||||
|
@ -1053,6 +1053,12 @@
|
||||||
(make-parameter (Cyc-stdin)))
|
(make-parameter (Cyc-stdin)))
|
||||||
(define current-error-port
|
(define current-error-port
|
||||||
(make-parameter (Cyc-stderr)))
|
(make-parameter (Cyc-stderr)))
|
||||||
|
;; TODO: only a first-step, error objects need to be more robust
|
||||||
|
(define (error-object? x)
|
||||||
|
(and (pair? x)
|
||||||
|
(string? (car x))))
|
||||||
|
(define error-object-message car)
|
||||||
|
(define error-object-irritants cdr)
|
||||||
(define (error msg . args)
|
(define (error msg . args)
|
||||||
(raise (cons msg args)))
|
(raise (cons msg args)))
|
||||||
(define (raise obj)
|
(define (raise obj)
|
||||||
|
|
Loading…
Add table
Reference in a new issue