mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +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-error-port
|
||||
call-with-port
|
||||
; TODO: error-object?
|
||||
; TODO: error-object-message
|
||||
; TODO: error-object-irritants
|
||||
error-object?
|
||||
error-object-message
|
||||
error-object-irritants
|
||||
; TODO: file-error?
|
||||
; TODO: read-error?
|
||||
error
|
||||
|
@ -1053,6 +1053,12 @@
|
|||
(make-parameter (Cyc-stdin)))
|
||||
(define current-error-port
|
||||
(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)
|
||||
(raise (cons msg args)))
|
||||
(define (raise obj)
|
||||
|
|
Loading…
Add table
Reference in a new issue