Change from Richard, Scheme 48 0.56 -> 0.56.9:

Define exception handler for TIME opcode.
This commit is contained in:
sperber 2001-07-10 13:13:27 +00:00
parent 0a1e5ab9bb
commit 7a45d9cc01
1 changed files with 9 additions and 0 deletions

View File

@ -29,6 +29,15 @@
(lambda (opcode reason arg)
(really-signal-condition arg)))
; The time opcode sometimes needs a little help.
(define-exception-handler (enum op time)
(lambda (opcode reason option arg0 . maybe-arg1)
(if (= reason (enum exception arithmetic-overflow))
(+ (* arg0 1000) ; seconds
(car maybe-arg1)) ; milliseconds
(apply signal-exception opcode reason option arg0 mayge-arg1))))
; This is for generic arithmetic, mostly
(define (extend-opcode! opcode make-handler)